<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE GADTs #-}</span><span>
</span><span id="line-3"></span><span class="hs-pragma">{-# LANGUAGE ScopedTypeVariables #-}</span><span>
</span><span id="line-4"></span><span class="hs-pragma">{-# LANGUAGE FlexibleContexts #-}</span><span>
</span><span id="line-5"></span><span class="hs-pragma">{-# LANGUAGE RankNTypes #-}</span><span>
</span><span id="line-6"></span><span class="hs-pragma">{-# LANGUAGE DeriveGeneric #-}</span><span>
</span><span id="line-7"></span><span class="hs-pragma">{-# LANGUAGE BangPatterns #-}</span><span>
</span><span id="line-8"></span><span>
</span><span id="line-9"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-11"></span><span class="hs-comment">-- Module      :  Distribution.Simple.Utils</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- Copyright   :  Isaac Jones, Simon Marlow 2003-2004</span><span>
</span><span id="line-13"></span><span class="hs-comment">-- License     :  BSD3</span><span>
</span><span id="line-14"></span><span class="hs-comment">--                portions Copyright (c) 2007, Galois Inc.</span><span>
</span><span id="line-15"></span><span class="hs-comment">--</span><span>
</span><span id="line-16"></span><span class="hs-comment">-- Maintainer  :  cabal-devel@haskell.org</span><span>
</span><span id="line-17"></span><span class="hs-comment">-- Portability :  portable</span><span>
</span><span id="line-18"></span><span class="hs-comment">--</span><span>
</span><span id="line-19"></span><span class="hs-comment">-- A large and somewhat miscellaneous collection of utility functions used</span><span>
</span><span id="line-20"></span><span class="hs-comment">-- throughout the rest of the Cabal lib and in other tools that use the Cabal</span><span>
</span><span id="line-21"></span><span class="hs-comment">-- lib like @cabal-install@. It has a very simple set of logging actions. It</span><span>
</span><span id="line-22"></span><span class="hs-comment">-- has low level functions for running programs, a bunch of wrappers for</span><span>
</span><span id="line-23"></span><span class="hs-comment">-- various directory and file functions that do extra logging.</span><span>
</span><span id="line-24"></span><span>
</span><span id="line-25"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Distribution.Simple.Utils</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-26"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#cabalVersion"><span class="hs-identifier">cabalVersion</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-27"></span><span>
</span><span id="line-28"></span><span>        </span><span class="annot"><span class="hs-comment">-- * logging and errors</span></span><span>
</span><span id="line-29"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#dieNoVerbosity"><span class="hs-identifier">dieNoVerbosity</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-30"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#die%27"><span class="hs-identifier">die'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Simple.Utils.html#dieWithLocation%27"><span class="hs-identifier">dieWithLocation'</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-31"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#dieNoWrap"><span class="hs-identifier">dieNoWrap</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-32"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#topHandler"><span class="hs-identifier">topHandler</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Simple.Utils.html#topHandlerWith"><span class="hs-identifier">topHandlerWith</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-33"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#warn"><span class="hs-identifier">warn</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-34"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#notice"><span class="hs-identifier">notice</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Simple.Utils.html#noticeNoWrap"><span class="hs-identifier">noticeNoWrap</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Simple.Utils.html#noticeDoc"><span class="hs-identifier">noticeDoc</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-35"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#setupMessage"><span class="hs-identifier">setupMessage</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-36"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#info"><span class="hs-identifier">info</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Simple.Utils.html#infoNoWrap"><span class="hs-identifier">infoNoWrap</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-37"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#debug"><span class="hs-identifier">debug</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Simple.Utils.html#debugNoWrap"><span class="hs-identifier">debugNoWrap</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-38"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#chattyTry"><span class="hs-identifier">chattyTry</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-39"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#annotateIO"><span class="hs-identifier">annotateIO</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-40"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#printRawCommandAndArgs"><span class="hs-identifier">printRawCommandAndArgs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Simple.Utils.html#printRawCommandAndArgsAndEnv"><span class="hs-identifier">printRawCommandAndArgsAndEnv</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-41"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#withOutputMarker"><span class="hs-identifier">withOutputMarker</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-42"></span><span>
</span><span id="line-43"></span><span>        </span><span class="annot"><span class="hs-comment">-- * exceptions</span></span><span>
</span><span id="line-44"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#handleDoesNotExist"><span class="hs-identifier">handleDoesNotExist</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-45"></span><span>
</span><span id="line-46"></span><span>        </span><span class="annot"><span class="hs-comment">-- * running programs</span></span><span>
</span><span id="line-47"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#rawSystemExit"><span class="hs-identifier">rawSystemExit</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-48"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#rawSystemExitCode"><span class="hs-identifier">rawSystemExitCode</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-49"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#rawSystemExitWithEnv"><span class="hs-identifier">rawSystemExitWithEnv</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-50"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#rawSystemStdout"><span class="hs-identifier">rawSystemStdout</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-51"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#rawSystemStdInOut"><span class="hs-identifier">rawSystemStdInOut</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-52"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#rawSystemIOWithEnv"><span class="hs-identifier">rawSystemIOWithEnv</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-53"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#rawSystemIOWithEnvAndAction"><span class="hs-identifier">rawSystemIOWithEnvAndAction</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-54"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#createProcessWithEnv"><span class="hs-identifier">createProcessWithEnv</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-55"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#maybeExit"><span class="hs-identifier">maybeExit</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-56"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#xargs"><span class="hs-identifier">xargs</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-57"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#findProgramVersion"><span class="hs-identifier">findProgramVersion</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-58"></span><span>
</span><span id="line-59"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** 'IOData' re-export</span></span><span>
</span><span id="line-60"></span><span>        </span><span class="hs-comment">--</span><span>
</span><span id="line-61"></span><span>        </span><span class="hs-comment">-- These types are re-exported from</span><span>
</span><span id="line-62"></span><span>        </span><span class="hs-comment">-- &quot;Distribution.Utils.IOData&quot; for convience as they're</span><span>
</span><span id="line-63"></span><span>        </span><span class="hs-comment">-- exposed in the API of 'rawSystemStdInOut'</span><span>
</span><span id="line-64"></span><span>        </span><span class="annot"><a href="Distribution.Utils.IOData.html#IOData"><span class="hs-identifier">IOData</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-65"></span><span>        </span><span class="annot"><a href="Distribution.Utils.IOData.html#KnownIODataMode"><span class="hs-identifier">KnownIODataMode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-66"></span><span>        </span><span class="annot"><a href="Distribution.Utils.IOData.html#IODataMode"><span class="hs-identifier">IODataMode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-67"></span><span>
</span><span id="line-68"></span><span>        </span><span class="annot"><span class="hs-comment">-- * copying files</span></span><span>
</span><span id="line-69"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#createDirectoryIfMissingVerbose"><span class="hs-identifier">createDirectoryIfMissingVerbose</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-70"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#copyFileVerbose"><span class="hs-identifier">copyFileVerbose</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-71"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#copyFiles"><span class="hs-identifier">copyFiles</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-72"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#copyFileTo"><span class="hs-identifier">copyFileTo</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-73"></span><span>
</span><span id="line-74"></span><span>        </span><span class="annot"><span class="hs-comment">-- * installing files</span></span><span>
</span><span id="line-75"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#installOrdinaryFile"><span class="hs-identifier">installOrdinaryFile</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-76"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#installExecutableFile"><span class="hs-identifier">installExecutableFile</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-77"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#installMaybeExecutableFile"><span class="hs-identifier">installMaybeExecutableFile</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-78"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#installOrdinaryFiles"><span class="hs-identifier">installOrdinaryFiles</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-79"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#installExecutableFiles"><span class="hs-identifier">installExecutableFiles</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-80"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#installMaybeExecutableFiles"><span class="hs-identifier">installMaybeExecutableFiles</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-81"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#installDirectoryContents"><span class="hs-identifier">installDirectoryContents</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-82"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#copyDirectoryRecursive"><span class="hs-identifier">copyDirectoryRecursive</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-83"></span><span>
</span><span id="line-84"></span><span>        </span><span class="annot"><span class="hs-comment">-- * File permissions</span></span><span>
</span><span id="line-85"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#doesExecutableExist"><span class="hs-identifier">doesExecutableExist</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-86"></span><span>        </span><span class="annot"><a href="Distribution.Compat.CopyFile.html#setFileOrdinary"><span class="hs-identifier">setFileOrdinary</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-87"></span><span>        </span><span class="annot"><a href="Distribution.Compat.CopyFile.html#setFileExecutable"><span class="hs-identifier">setFileExecutable</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-88"></span><span>
</span><span id="line-89"></span><span>        </span><span class="annot"><span class="hs-comment">-- * file names</span></span><span>
</span><span id="line-90"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#currentDir"><span class="hs-identifier">currentDir</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-91"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#shortRelativePath"><span class="hs-identifier">shortRelativePath</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-92"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#dropExeExtension"><span class="hs-identifier">dropExeExtension</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-93"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#exeExtensions"><span class="hs-identifier">exeExtensions</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-94"></span><span>
</span><span id="line-95"></span><span>        </span><span class="annot"><span class="hs-comment">-- * finding files</span></span><span>
</span><span id="line-96"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#findFileEx"><span class="hs-identifier">findFileEx</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-97"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#findFileCwd"><span class="hs-identifier">findFileCwd</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-98"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#findFirstFile"><span class="hs-identifier">findFirstFile</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-99"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#findFileWithExtension"><span class="hs-identifier">findFileWithExtension</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-100"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#findFileCwdWithExtension"><span class="hs-identifier">findFileCwdWithExtension</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-101"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#findFileWithExtension%27"><span class="hs-identifier">findFileWithExtension'</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-102"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#findAllFilesWithExtension"><span class="hs-identifier">findAllFilesWithExtension</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-103"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#findAllFilesCwdWithExtension"><span class="hs-identifier">findAllFilesCwdWithExtension</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-104"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#findModuleFileEx"><span class="hs-identifier">findModuleFileEx</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-105"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#findModuleFilesEx"><span class="hs-identifier">findModuleFilesEx</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-106"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#getDirectoryContentsRecursive"><span class="hs-identifier">getDirectoryContentsRecursive</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-107"></span><span>
</span><span id="line-108"></span><span>        </span><span class="annot"><span class="hs-comment">-- * environment variables</span></span><span>
</span><span id="line-109"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#isInSearchPath"><span class="hs-identifier">isInSearchPath</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-110"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#addLibraryPath"><span class="hs-identifier">addLibraryPath</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-111"></span><span>
</span><span id="line-112"></span><span>        </span><span class="annot"><span class="hs-comment">-- * modification time</span></span><span>
</span><span id="line-113"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#moreRecentFile"><span class="hs-identifier">moreRecentFile</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-114"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#existsAndIsMoreRecentThan"><span class="hs-identifier">existsAndIsMoreRecentThan</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-115"></span><span>
</span><span id="line-116"></span><span>        </span><span class="annot"><span class="hs-comment">-- * temp files and dirs</span></span><span>
</span><span id="line-117"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#TempFileOptions"><span class="hs-identifier">TempFileOptions</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Simple.Utils.html#defaultTempFileOptions"><span class="hs-identifier">defaultTempFileOptions</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-118"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#withTempFile"><span class="hs-identifier">withTempFile</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Simple.Utils.html#withTempFileEx"><span class="hs-identifier">withTempFileEx</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-119"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#withTempDirectory"><span class="hs-identifier">withTempDirectory</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Simple.Utils.html#withTempDirectoryEx"><span class="hs-identifier">withTempDirectoryEx</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-120"></span><span>        </span><span class="annot"><a href="Distribution.Compat.Internal.TempFile.html#createTempDirectory"><span class="hs-identifier">createTempDirectory</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-121"></span><span>
</span><span id="line-122"></span><span>        </span><span class="annot"><span class="hs-comment">-- * .cabal and .buildinfo files</span></span><span>
</span><span id="line-123"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#defaultPackageDesc"><span class="hs-identifier">defaultPackageDesc</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-124"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#findPackageDesc"><span class="hs-identifier">findPackageDesc</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-125"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#findPackageDescCwd"><span class="hs-identifier">findPackageDescCwd</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-126"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#tryFindPackageDesc"><span class="hs-identifier">tryFindPackageDesc</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-127"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#tryFindPackageDescCwd"><span class="hs-identifier">tryFindPackageDescCwd</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-128"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#findHookedPackageDesc"><span class="hs-identifier">findHookedPackageDesc</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-129"></span><span>
</span><span id="line-130"></span><span>        </span><span class="annot"><span class="hs-comment">-- * reading and writing files safely</span></span><span>
</span><span id="line-131"></span><span>        </span><span class="annot"><a href="Distribution.Utils.Generic.html#withFileContents"><span class="hs-identifier">withFileContents</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-132"></span><span>        </span><span class="annot"><a href="Distribution.Utils.Generic.html#writeFileAtomic"><span class="hs-identifier">writeFileAtomic</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-133"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#rewriteFileEx"><span class="hs-identifier">rewriteFileEx</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-134"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#rewriteFileLBS"><span class="hs-identifier">rewriteFileLBS</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-135"></span><span>
</span><span id="line-136"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Unicode</span></span><span>
</span><span id="line-137"></span><span>        </span><span class="annot"><a href="Distribution.Utils.Generic.html#fromUTF8BS"><span class="hs-identifier">fromUTF8BS</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-138"></span><span>        </span><span class="annot"><a href="Distribution.Utils.Generic.html#fromUTF8LBS"><span class="hs-identifier">fromUTF8LBS</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-139"></span><span>        </span><span class="annot"><a href="Distribution.Utils.Generic.html#toUTF8BS"><span class="hs-identifier">toUTF8BS</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-140"></span><span>        </span><span class="annot"><a href="Distribution.Utils.Generic.html#toUTF8LBS"><span class="hs-identifier">toUTF8LBS</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-141"></span><span>        </span><span class="annot"><a href="Distribution.Utils.Generic.html#readUTF8File"><span class="hs-identifier">readUTF8File</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-142"></span><span>        </span><span class="annot"><a href="Distribution.Utils.Generic.html#withUTF8FileContents"><span class="hs-identifier">withUTF8FileContents</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-143"></span><span>        </span><span class="annot"><a href="Distribution.Utils.Generic.html#writeUTF8File"><span class="hs-identifier">writeUTF8File</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-144"></span><span>        </span><span class="annot"><a href="Distribution.Utils.Generic.html#normaliseLineEndings"><span class="hs-identifier">normaliseLineEndings</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-145"></span><span>
</span><span id="line-146"></span><span>        </span><span class="annot"><span class="hs-comment">-- * BOM</span></span><span>
</span><span id="line-147"></span><span>        </span><span class="annot"><a href="Distribution.Utils.Generic.html#ignoreBOM"><span class="hs-identifier">ignoreBOM</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-148"></span><span>
</span><span id="line-149"></span><span>        </span><span class="annot"><span class="hs-comment">-- * generic utils</span></span><span>
</span><span id="line-150"></span><span>        </span><span class="annot"><a href="Distribution.Utils.Generic.html#dropWhileEndLE"><span class="hs-identifier">dropWhileEndLE</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-151"></span><span>        </span><span class="annot"><a href="Distribution.Utils.Generic.html#takeWhileEndLE"><span class="hs-identifier">takeWhileEndLE</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-152"></span><span>        </span><span class="annot"><a href="Distribution.Utils.Generic.html#equating"><span class="hs-identifier">equating</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-153"></span><span>        </span><span class="annot"><a href="../../base/src/Data.Ord.html#comparing"><span class="hs-identifier">comparing</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-154"></span><span>        </span><span class="annot"><a href="../../base/src/Data.OldList.html#isInfixOf"><span class="hs-identifier">isInfixOf</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-155"></span><span>        </span><span class="annot"><a href="../../base/src/Data.OldList.html#intercalate"><span class="hs-identifier">intercalate</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-156"></span><span>        </span><span class="annot"><a href="Distribution.Utils.Generic.html#lowercase"><span class="hs-identifier">lowercase</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-157"></span><span>        </span><span class="annot"><a href="Distribution.Utils.Generic.html#listUnion"><span class="hs-identifier">listUnion</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-158"></span><span>        </span><span class="annot"><a href="Distribution.Utils.Generic.html#listUnionRight"><span class="hs-identifier">listUnionRight</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-159"></span><span>        </span><span class="annot"><a href="Distribution.Utils.Generic.html#ordNub"><span class="hs-identifier">ordNub</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-160"></span><span>        </span><span class="annot"><a href="Distribution.Utils.Generic.html#ordNubBy"><span class="hs-identifier">ordNubBy</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-161"></span><span>        </span><span class="annot"><a href="Distribution.Utils.Generic.html#ordNubRight"><span class="hs-identifier">ordNubRight</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-162"></span><span>        </span><span class="annot"><a href="Distribution.Utils.Generic.html#safeHead"><span class="hs-identifier">safeHead</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-163"></span><span>        </span><span class="annot"><a href="Distribution.Utils.Generic.html#safeTail"><span class="hs-identifier">safeTail</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-164"></span><span>        </span><span class="annot"><a href="Distribution.Utils.Generic.html#safeLast"><span class="hs-identifier">safeLast</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-165"></span><span>        </span><span class="annot"><a href="Distribution.Utils.Generic.html#safeInit"><span class="hs-identifier">safeInit</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-166"></span><span>        </span><span class="annot"><a href="Distribution.Utils.Generic.html#unintersperse"><span class="hs-identifier">unintersperse</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-167"></span><span>        </span><span class="annot"><a href="Distribution.Utils.Generic.html#wrapText"><span class="hs-identifier">wrapText</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-168"></span><span>        </span><span class="annot"><a href="Distribution.Utils.Generic.html#wrapLine"><span class="hs-identifier">wrapLine</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-169"></span><span>
</span><span id="line-170"></span><span>        </span><span class="annot"><span class="hs-comment">-- * FilePath stuff</span></span><span>
</span><span id="line-171"></span><span>        </span><span class="annot"><a href="Distribution.Utils.Generic.html#isAbsoluteOnAnyPlatform"><span class="hs-identifier">isAbsoluteOnAnyPlatform</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-172"></span><span>        </span><span class="annot"><a href="Distribution.Utils.Generic.html#isRelativeOnAnyPlatform"><span class="hs-identifier">isRelativeOnAnyPlatform</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-173"></span><span>
</span><span id="line-174"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Deprecated functions</span></span><span>
</span><span id="line-175"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#findFile"><span class="hs-identifier">findFile</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-176"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#findModuleFile"><span class="hs-identifier">findModuleFile</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-177"></span><span>        </span><span class="annot"><a href="Distribution.Simple.Utils.html#findModuleFiles"><span class="hs-identifier">findModuleFiles</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-178"></span><span>  </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-179"></span><span>
</span><span id="line-180"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Prelude.html#"><span class="hs-identifier">Prelude</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-181"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Compat.Prelude.html"><span class="hs-identifier">Distribution.Compat.Prelude</span></a></span><span>
</span><span id="line-182"></span><span>
</span><span id="line-183"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Utils.Generic.html"><span class="hs-identifier">Distribution.Utils.Generic</span></a></span><span>
</span><span id="line-184"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Utils.IOData.html"><span class="hs-identifier">Distribution.Utils.IOData</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Utils.IOData.html#IOData"><span class="hs-identifier">IOData</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Utils.IOData.html#IODataMode"><span class="hs-identifier">IODataMode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Utils.IOData.html#KnownIODataMode"><span class="hs-identifier">KnownIODataMode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-185"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="Distribution.Utils.IOData.html"><span class="hs-identifier">Distribution.Utils.IOData</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">IOData</span></span><span>
</span><span id="line-186"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.ModuleName.html"><span class="hs-identifier">Distribution.ModuleName</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">ModuleName</span></span><span>
</span><span id="line-187"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.System.html"><span class="hs-identifier">Distribution.System</span></a></span><span>
</span><span id="line-188"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Version.html"><span class="hs-identifier">Distribution.Version</span></a></span><span>
</span><span id="line-189"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Compat.Async.html"><span class="hs-identifier">Distribution.Compat.Async</span></a></span><span>
</span><span id="line-190"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Compat.CopyFile.html"><span class="hs-identifier">Distribution.Compat.CopyFile</span></a></span><span>
</span><span id="line-191"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Compat.Internal.TempFile.html"><span class="hs-identifier">Distribution.Compat.Internal.TempFile</span></a></span><span>
</span><span id="line-192"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Compat.FilePath.html"><span class="hs-identifier">Distribution.Compat.FilePath</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">FilePath</span></span><span>
</span><span id="line-193"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Compat.Stack.html"><span class="hs-identifier">Distribution.Compat.Stack</span></a></span><span>
</span><span id="line-194"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html"><span class="hs-identifier">Distribution.Verbosity</span></a></span><span>
</span><span id="line-195"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Types.PackageId.html"><span class="hs-identifier">Distribution.Types.PackageId</span></a></span><span class="hs-cpp">

#if __GLASGOW_HASKELL__ &lt; 711
</span><span class="hs-cpp">#ifdef VERSION_base
</span><span class="hs-cpp">#define BOOTSTRAPPED_CABAL 1
</span><span class="hs-cpp">#endif
</span><span class="hs-cpp">#else
</span><span class="hs-cpp">#ifdef CURRENT_PACKAGE_KEY
</span><span class="hs-cpp">#define BOOTSTRAPPED_CABAL 1
</span><span class="hs-cpp">#endif
</span><span class="hs-cpp">#endif
</span><span class="hs-cpp">
#ifdef BOOTSTRAPPED_CABAL
</span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="Paths_Cabal.html"><span class="hs-identifier">Paths_Cabal</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Paths_Cabal.html#version"><span class="hs-identifier">version</span></a></span><span class="hs-special">)</span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-211"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Pretty.html"><span class="hs-identifier">Distribution.Pretty</span></a></span><span>
</span><span id="line-212"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Parsec.html"><span class="hs-identifier">Distribution.Parsec</span></a></span><span>
</span><span id="line-213"></span><span>
</span><span id="line-214"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Typeable.html#"><span class="hs-identifier">Data.Typeable</span></a></span><span>
</span><span id="line-215"></span><span>    </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Data.Typeable.html#cast"><span class="hs-identifier">cast</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-216"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Lazy.html#"><span class="hs-identifier">Data.ByteString.Lazy</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">BS</span></span><span>
</span><span id="line-217"></span><span>
</span><span id="line-218"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../directory/src/System.Directory.html#"><span class="hs-identifier">System.Directory</span></a></span><span>
</span><span id="line-219"></span><span>    </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../directory/src/System.Directory.Internal.Common.html#Permissions"><span class="hs-identifier">Permissions</span></a></span><span class="hs-special">(</span><span class="annot"><a href="../../directory/src/System.Directory.Internal.Common.html#executable"><span class="hs-identifier">executable</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../directory/src/System.Directory.html#getDirectoryContents"><span class="hs-identifier">getDirectoryContents</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../directory/src/System.Directory.html#getPermissions"><span class="hs-identifier">getPermissions</span></a></span><span>
</span><span id="line-220"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../directory/src/System.Directory.html#doesDirectoryExist"><span class="hs-identifier">doesDirectoryExist</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../directory/src/System.Directory.html#doesFileExist"><span class="hs-identifier">doesFileExist</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../directory/src/System.Directory.html#removeFile"><span class="hs-identifier">removeFile</span></a></span><span>
</span><span id="line-221"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../directory/src/System.Directory.html#getModificationTime"><span class="hs-identifier">getModificationTime</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../directory/src/System.Directory.html#createDirectory"><span class="hs-identifier">createDirectory</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../directory/src/System.Directory.html#removeDirectoryRecursive"><span class="hs-identifier">removeDirectoryRecursive</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-222"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/System.Environment.html#"><span class="hs-identifier">System.Environment</span></a></span><span>
</span><span id="line-223"></span><span>    </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/System.Environment.html#getProgName"><span class="hs-identifier">getProgName</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-224"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../filepath/src/System.FilePath.html#"><span class="hs-identifier">System.FilePath</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">FilePath</span></span><span>
</span><span id="line-225"></span><span>    </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../filepath/src/System.FilePath.Windows.html#normalise"><span class="hs-identifier">normalise</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator">(&lt;/&gt;)</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../filepath/src/System.FilePath.Windows.html#%3C.%3E"><span class="hs-operator">(&lt;.&gt;)</span></a></span><span>
</span><span id="line-226"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../filepath/src/System.FilePath.Windows.html#getSearchPath"><span class="hs-identifier">getSearchPath</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../filepath/src/System.FilePath.Windows.html#joinPath"><span class="hs-identifier">joinPath</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../filepath/src/System.FilePath.Windows.html#takeDirectory"><span class="hs-identifier">takeDirectory</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../filepath/src/System.FilePath.Windows.html#splitExtension"><span class="hs-identifier">splitExtension</span></a></span><span>
</span><span id="line-227"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../filepath/src/System.FilePath.Windows.html#splitDirectories"><span class="hs-identifier">splitDirectories</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../filepath/src/System.FilePath.Windows.html#searchPathSeparator"><span class="hs-identifier">searchPathSeparator</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-228"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/System.IO.html#"><span class="hs-identifier">System.IO</span></a></span><span>
</span><span id="line-229"></span><span>    </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Types.html#Handle"><span class="hs-identifier">Handle</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.html#hSetBinaryMode"><span class="hs-identifier">hSetBinaryMode</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Text.html#hGetContents"><span class="hs-identifier">hGetContents</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.StdHandles.html#stderr"><span class="hs-identifier">stderr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.StdHandles.html#stdout"><span class="hs-identifier">stdout</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Text.html#hPutStr"><span class="hs-identifier">hPutStr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.html#hFlush"><span class="hs-identifier">hFlush</span></a></span><span>
</span><span id="line-230"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.html#hClose"><span class="hs-identifier">hClose</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.html#hSetBuffering"><span class="hs-identifier">hSetBuffering</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Types.html#BufferMode"><span class="hs-identifier">BufferMode</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Text.html#hPutStrLn"><span class="hs-identifier">hPutStrLn</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-231"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/System.IO.Error.html#"><span class="hs-identifier">System.IO.Error</span></a></span><span>
</span><span id="line-232"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/System.IO.Unsafe.html#"><span class="hs-identifier">System.IO.Unsafe</span></a></span><span>
</span><span id="line-233"></span><span>    </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Unsafe.html#unsafeInterleaveIO"><span class="hs-identifier">unsafeInterleaveIO</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-234"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../base/src/Control.Exception.html#"><span class="hs-identifier">Control.Exception</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Exception</span></span><span>
</span><span id="line-235"></span><span>
</span><span id="line-236"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Foreign.C.Error.html#"><span class="hs-identifier">Foreign.C.Error</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Foreign.C.Error.html#Errno"><span class="hs-identifier">Errno</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Foreign.C.Error.html#ePIPE"><span class="hs-identifier">ePIPE</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-237"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../time/src/Data.Time.Clock.POSIX.html#"><span class="hs-identifier">Data.Time.Clock.POSIX</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../time/src/Data.Time.Clock.POSIX.html#getPOSIXTime"><span class="hs-identifier">getPOSIXTime</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../time/src/Data.Time.Clock.Internal.POSIXTime.html#POSIXTime"><span class="hs-identifier">POSIXTime</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-238"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Numeric.html#"><span class="hs-identifier">Numeric</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Numeric.html#showFFloat"><span class="hs-identifier">showFFloat</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-239"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Compat.Process.html"><span class="hs-identifier">Distribution.Compat.Process</span></a></span><span>  </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Compat.Process.html#createProcess"><span class="hs-identifier">createProcess</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Compat.Process.html#rawSystem"><span class="hs-identifier">rawSystem</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Compat.Process.html#runInteractiveProcess"><span class="hs-identifier">runInteractiveProcess</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-240"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../process/src/System.Process.html#"><span class="hs-identifier">System.Process</span></a></span><span>
</span><span id="line-241"></span><span>         </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../process/src/System.Process.Common.html#ProcessHandle"><span class="hs-identifier">ProcessHandle</span></a></span><span>
</span><span id="line-242"></span><span>         </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../process/src/System.Process.html#showCommandForUser"><span class="hs-identifier">showCommandForUser</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../process/src/System.Process.html#waitForProcess"><span class="hs-identifier">waitForProcess</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-243"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../process/src/System.Process.html#"><span class="hs-identifier">System.Process</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Process</span></span><span>
</span><span id="line-244"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Exception.html#"><span class="hs-identifier">GHC.IO.Exception</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">GHC</span></span><span>
</span><span id="line-245"></span><span>
</span><span id="line-246"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../pretty/src/Text.PrettyPrint.html#"><span class="hs-identifier">Text.PrettyPrint</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Disp</span></span><span>
</span><span id="line-247"></span><span>
</span><span id="line-248"></span><span class="hs-comment">-- We only get our own version number when we're building with ourselves</span><span>
</span><span id="line-249"></span><span class="annot"><a href="Distribution.Simple.Utils.html#cabalVersion"><span class="hs-identifier hs-type">cabalVersion</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Types.Version.html#Version"><span class="hs-identifier hs-type">Version</span></a></span><span class="hs-cpp">
#if defined(BOOTSTRAPPED_CABAL)
</span><span id="cabalVersion"><span class="annot"><span class="annottext">cabalVersion :: Version
</span><a href="Distribution.Simple.Utils.html#cabalVersion"><span class="hs-identifier hs-var hs-var">cabalVersion</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Version -&gt; Version
</span><a href="Distribution.Types.Version.html#mkVersion%27"><span class="hs-identifier hs-var">mkVersion'</span></a></span><span> </span><span class="annot"><span class="annottext">Version
</span><a href="Paths_Cabal.html#version"><span class="hs-identifier hs-var">Paths_Cabal.version</span></a></span><span class="hs-cpp">
#elif defined(CABAL_VERSION)
</span><span class="hs-identifier">cabalVersion</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">mkVersion</span><span> </span><span class="hs-special">[</span><span class="hs-identifier">CABAL_VERSION</span><span class="hs-special">]</span><span class="hs-cpp">
#else
</span><span class="hs-identifier">cabalVersion</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">mkVersion</span><span> </span><span class="hs-special">[</span><span class="hs-number">3</span><span class="hs-special">,</span><span class="hs-number">0</span><span class="hs-special">]</span><span>  </span><span class="hs-comment">--used when bootstrapping</span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-258"></span><span class="hs-comment">-- ----------------------------------------------------------------------------</span><span>
</span><span id="line-259"></span><span class="hs-comment">-- Exception and logging utils</span><span>
</span><span id="line-260"></span><span>
</span><span id="line-261"></span><span class="hs-comment">-- Cabal's logging infrastructure has a few constraints:</span><span>
</span><span id="line-262"></span><span class="hs-comment">--</span><span>
</span><span id="line-263"></span><span class="hs-comment">--  * We must make all logging formatting and emissions decisions based</span><span>
</span><span id="line-264"></span><span class="hs-comment">--    on the 'Verbosity' parameter, which is the only parameter that is</span><span>
</span><span id="line-265"></span><span class="hs-comment">--    plumbed to enough call-sites to actually be used for this matter.</span><span>
</span><span id="line-266"></span><span class="hs-comment">--    (One of Cabal's &quot;big mistakes&quot; is to have never have defined a</span><span>
</span><span id="line-267"></span><span class="hs-comment">--    monad of its own.)</span><span>
</span><span id="line-268"></span><span class="hs-comment">--</span><span>
</span><span id="line-269"></span><span class="hs-comment">--  * When we 'die', we must raise an IOError.  This a backwards</span><span>
</span><span id="line-270"></span><span class="hs-comment">--    compatibility consideration, because that's what we've raised</span><span>
</span><span id="line-271"></span><span class="hs-comment">--    previously, and if we change to any other exception type,</span><span>
</span><span id="line-272"></span><span class="hs-comment">--    exception handlers which match on IOError will no longer work.</span><span>
</span><span id="line-273"></span><span class="hs-comment">--    One case where it is known we rely on IOError being catchable</span><span>
</span><span id="line-274"></span><span class="hs-comment">--    is 'readPkgConfigDb' in cabal-install; there may be other</span><span>
</span><span id="line-275"></span><span class="hs-comment">--    user code that also assumes this.</span><span>
</span><span id="line-276"></span><span class="hs-comment">--</span><span>
</span><span id="line-277"></span><span class="hs-comment">--  * The 'topHandler' does not know what 'Verbosity' is, because</span><span>
</span><span id="line-278"></span><span class="hs-comment">--    it gets called before we've done command line parsing (where</span><span>
</span><span id="line-279"></span><span class="hs-comment">--    the 'Verbosity' parameter would come from).</span><span>
</span><span id="line-280"></span><span class="hs-comment">--</span><span>
</span><span id="line-281"></span><span class="hs-comment">-- This leads to two big architectural choices:</span><span>
</span><span id="line-282"></span><span class="hs-comment">--</span><span>
</span><span id="line-283"></span><span class="hs-comment">--  * Although naively we might imagine 'Verbosity' to be a simple</span><span>
</span><span id="line-284"></span><span class="hs-comment">--    enumeration type, actually it is a full-on abstract data type</span><span>
</span><span id="line-285"></span><span class="hs-comment">--    that may contain arbitrarily complex information.  At the</span><span>
</span><span id="line-286"></span><span class="hs-comment">--    moment, it is fully representable as a string, but we might</span><span>
</span><span id="line-287"></span><span class="hs-comment">--    eventually also use verbosity to let users register their</span><span>
</span><span id="line-288"></span><span class="hs-comment">--    own logging handler.</span><span>
</span><span id="line-289"></span><span class="hs-comment">--</span><span>
</span><span id="line-290"></span><span class="hs-comment">--  * When we call 'die', we perform all the formatting and addition</span><span>
</span><span id="line-291"></span><span class="hs-comment">--    of extra information we need, and then ship this in the IOError</span><span>
</span><span id="line-292"></span><span class="hs-comment">--    to the top-level handler.  Here are alternate designs that</span><span>
</span><span id="line-293"></span><span class="hs-comment">--    don't work:</span><span>
</span><span id="line-294"></span><span class="hs-comment">--</span><span>
</span><span id="line-295"></span><span class="hs-comment">--      a) Ship the unformatted info to the handler.  This doesn't</span><span>
</span><span id="line-296"></span><span class="hs-comment">--      work because at the point the handler gets the message,</span><span>
</span><span id="line-297"></span><span class="hs-comment">--      we've lost call stacks, and even if we did, we don't have access</span><span>
</span><span id="line-298"></span><span class="hs-comment">--      to 'Verbosity' to decide whether or not to render it.</span><span>
</span><span id="line-299"></span><span class="hs-comment">--</span><span>
</span><span id="line-300"></span><span class="hs-comment">--      b) Print the information at the 'die' site, then raise an</span><span>
</span><span id="line-301"></span><span class="hs-comment">--      error.  This means that if the exception is subsequently</span><span>
</span><span id="line-302"></span><span class="hs-comment">--      caught by a handler, we will still have emitted the output,</span><span>
</span><span id="line-303"></span><span class="hs-comment">--      which is not the correct behavior.</span><span>
</span><span id="line-304"></span><span class="hs-comment">--</span><span>
</span><span id="line-305"></span><span class="hs-comment">--    For the top-level handler to &quot;know&quot; that an error message</span><span>
</span><span id="line-306"></span><span class="hs-comment">--    contains one of these fully formatted packets, we set a sentinel</span><span>
</span><span id="line-307"></span><span class="hs-comment">--    in one of IOError's extra fields.  This is handled by</span><span>
</span><span id="line-308"></span><span class="hs-comment">--    'ioeSetVerbatim' and 'ioeGetVerbatim'.</span><span>
</span><span id="line-309"></span><span class="hs-comment">--</span><span>
</span><span id="line-310"></span><span>
</span><span id="line-311"></span><span id="local-6989586621679683205"><span class="annot"><a href="Distribution.Simple.Utils.html#dieNoVerbosity"><span class="hs-identifier hs-type">dieNoVerbosity</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621679683205"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-312"></span><span id="dieNoVerbosity"><span class="annot"><span class="annottext">dieNoVerbosity :: forall a. String -&gt; IO a
</span><a href="Distribution.Simple.Utils.html#dieNoVerbosity"><span class="hs-identifier hs-var hs-var">dieNoVerbosity</span></a></span></span><span> </span><span id="local-6989586621679682669"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682669"><span class="hs-identifier hs-var">msg</span></a></span></span><span>
</span><span id="line-313"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IOException -&gt; IO a
forall a. IOException -&gt; IO a
</span><a href="../../base/src/GHC.IO.Exception.html#ioError"><span class="hs-identifier hs-var">ioError</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; IOException
</span><a href="../../base/src/GHC.IO.Exception.html#userError"><span class="hs-identifier hs-var">userError</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682669"><span class="hs-identifier hs-var">msg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-314"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-315"></span><span>    </span><span class="annot"><span class="annottext">CallStack
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CallStack
HasCallStack =&gt; CallStack
</span><a href="../../base/src/GHC.Stack.html#callStack"><span class="hs-identifier hs-var">callStack</span></a></span><span> </span><span class="hs-comment">-- TODO: Attach CallStack to exception</span><span>
</span><span id="line-316"></span><span>
</span><span id="line-317"></span><span class="hs-comment">-- | Tag an 'IOError' whose error string should be output to the screen</span><span>
</span><span id="line-318"></span><span class="hs-comment">-- verbatim.</span><span>
</span><span id="line-319"></span><span class="annot"><a href="Distribution.Simple.Utils.html#ioeSetVerbatim"><span class="hs-identifier hs-type">ioeSetVerbatim</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Exception.html#IOError"><span class="hs-identifier hs-type">IOError</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Exception.html#IOError"><span class="hs-identifier hs-type">IOError</span></a></span><span>
</span><span id="line-320"></span><span id="ioeSetVerbatim"><span class="annot"><span class="annottext">ioeSetVerbatim :: IOException -&gt; IOException
</span><a href="Distribution.Simple.Utils.html#ioeSetVerbatim"><span class="hs-identifier hs-var hs-var">ioeSetVerbatim</span></a></span></span><span> </span><span id="local-6989586621679682661"><span class="annot"><span class="annottext">IOException
</span><a href="#local-6989586621679682661"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IOException -&gt; String -&gt; IOException
</span><a href="../../base/src/System.IO.Error.html#ioeSetLocation"><span class="hs-identifier hs-var">ioeSetLocation</span></a></span><span> </span><span class="annot"><span class="annottext">IOException
</span><a href="#local-6989586621679682661"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;dieVerbatim&quot;</span></span><span>
</span><span id="line-321"></span><span>
</span><span id="line-322"></span><span class="hs-comment">-- | Check if an 'IOError' should be output verbatim to screen.</span><span>
</span><span id="line-323"></span><span class="annot"><a href="Distribution.Simple.Utils.html#ioeGetVerbatim"><span class="hs-identifier hs-type">ioeGetVerbatim</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Exception.html#IOError"><span class="hs-identifier hs-type">IOError</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-324"></span><span id="ioeGetVerbatim"><span class="annot"><span class="annottext">ioeGetVerbatim :: IOException -&gt; Bool
</span><a href="Distribution.Simple.Utils.html#ioeGetVerbatim"><span class="hs-identifier hs-var hs-var">ioeGetVerbatim</span></a></span></span><span> </span><span id="local-6989586621679682658"><span class="annot"><span class="annottext">IOException
</span><a href="#local-6989586621679682658"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IOException -&gt; String
</span><a href="../../base/src/System.IO.Error.html#ioeGetLocation"><span class="hs-identifier hs-var">ioeGetLocation</span></a></span><span> </span><span class="annot"><span class="annottext">IOException
</span><a href="#local-6989586621679682658"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;dieVerbatim&quot;</span></span><span>
</span><span id="line-325"></span><span>
</span><span id="line-326"></span><span class="hs-comment">-- | Create a 'userError' whose error text will be output verbatim</span><span>
</span><span id="line-327"></span><span class="annot"><a href="Distribution.Simple.Utils.html#verbatimUserError"><span class="hs-identifier hs-type">verbatimUserError</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Exception.html#IOError"><span class="hs-identifier hs-type">IOError</span></a></span><span>
</span><span id="line-328"></span><span id="verbatimUserError"><span class="annot"><span class="annottext">verbatimUserError :: String -&gt; IOException
</span><a href="Distribution.Simple.Utils.html#verbatimUserError"><span class="hs-identifier hs-var hs-var">verbatimUserError</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IOException -&gt; IOException
</span><a href="Distribution.Simple.Utils.html#ioeSetVerbatim"><span class="hs-identifier hs-var">ioeSetVerbatim</span></a></span><span> </span><span class="annot"><span class="annottext">(IOException -&gt; IOException)
-&gt; (String -&gt; IOException) -&gt; String -&gt; IOException
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; IOException
</span><a href="../../base/src/GHC.IO.Exception.html#userError"><span class="hs-identifier hs-var">userError</span></a></span><span>
</span><span id="line-329"></span><span>
</span><span id="line-330"></span><span id="local-6989586621679683198"><span class="annot"><a href="Distribution.Simple.Utils.html#dieWithLocation%27"><span class="hs-identifier hs-type">dieWithLocation'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621679683198"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-331"></span><span id="dieWithLocation%27"><span class="annot"><span class="annottext">dieWithLocation' :: forall a. Verbosity -&gt; String -&gt; Maybe Int -&gt; String -&gt; IO a
</span><a href="Distribution.Simple.Utils.html#dieWithLocation%27"><span class="hs-identifier hs-var hs-var">dieWithLocation'</span></a></span></span><span> </span><span id="local-6989586621679682651"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682651"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679682650"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682650"><span class="hs-identifier hs-var">filename</span></a></span></span><span> </span><span id="local-6989586621679682649"><span class="annot"><span class="annottext">Maybe Int
</span><a href="#local-6989586621679682649"><span class="hs-identifier hs-var">mb_lineno</span></a></span></span><span> </span><span id="local-6989586621679682648"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682648"><span class="hs-identifier hs-var">msg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HasCallStack =&gt; IO a) -&gt; IO a
forall a. HasCallStack =&gt; (HasCallStack =&gt; a) -&gt; a
</span><a href="../../base/src/GHC.Stack.html#withFrozenCallStack"><span class="hs-identifier hs-var">withFrozenCallStack</span></a></span><span> </span><span class="annot"><span class="annottext">((HasCallStack =&gt; IO a) -&gt; IO a) -&gt; (HasCallStack =&gt; IO a) -&gt; IO a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-332"></span><span>    </span><span id="local-6989586621679682639"><span class="annot"><span class="annottext">POSIXTime
</span><a href="#local-6989586621679682639"><span class="hs-identifier hs-var">ts</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO POSIXTime
</span><a href="../../time/src/Data.Time.Clock.POSIX.html#getPOSIXTime"><span class="hs-identifier hs-var">getPOSIXTime</span></a></span><span>
</span><span id="line-333"></span><span>    </span><span id="local-6989586621679682638"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682638"><span class="hs-identifier hs-var">pname</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO String
</span><a href="../../base/src/System.Environment.html#getProgName"><span class="hs-identifier hs-var">getProgName</span></a></span><span>
</span><span id="line-334"></span><span>    </span><span class="annot"><span class="annottext">IOException -&gt; IO a
forall a. IOException -&gt; IO a
</span><a href="../../base/src/GHC.IO.Exception.html#ioError"><span class="hs-identifier hs-var">ioError</span></a></span><span> </span><span class="annot"><span class="annottext">(IOException -&gt; IO a) -&gt; (String -&gt; IOException) -&gt; String -&gt; IO a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; IOException
</span><a href="Distribution.Simple.Utils.html#verbatimUserError"><span class="hs-identifier hs-var">verbatimUserError</span></a></span><span>
</span><span id="line-335"></span><span>            </span><span class="annot"><span class="annottext">(String -&gt; IOException)
-&gt; (String -&gt; String) -&gt; String -&gt; IOException
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">WithCallStack
  (POSIXTime
   -&gt; MarkWhen -&gt; TraceWhen -&gt; Verbosity -&gt; String -&gt; String)
POSIXTime -&gt; MarkWhen -&gt; TraceWhen -&gt; Verbosity -&gt; String -&gt; String
</span><a href="Distribution.Simple.Utils.html#withMetadata"><span class="hs-identifier hs-var">withMetadata</span></a></span><span> </span><span class="annot"><span class="annottext">POSIXTime
</span><a href="#local-6989586621679682639"><span class="hs-identifier hs-var">ts</span></a></span><span> </span><span class="annot"><span class="annottext">MarkWhen
</span><a href="Distribution.Simple.Utils.html#AlwaysMark"><span class="hs-identifier hs-var">AlwaysMark</span></a></span><span> </span><span class="annot"><span class="annottext">TraceWhen
</span><a href="Distribution.Simple.Utils.html#VerboseTrace"><span class="hs-identifier hs-var">VerboseTrace</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682651"><span class="hs-identifier hs-var">verbosity</span></a></span><span>
</span><span id="line-336"></span><span>            </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; (String -&gt; String) -&gt; String -&gt; String
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; String
</span><a href="Distribution.Simple.Utils.html#wrapTextVerbosity"><span class="hs-identifier hs-var">wrapTextVerbosity</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682651"><span class="hs-identifier hs-var">verbosity</span></a></span><span>
</span><span id="line-337"></span><span>            </span><span class="annot"><span class="annottext">(String -&gt; IO a) -&gt; String -&gt; IO a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682638"><span class="hs-identifier hs-var">pname</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;: &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span>
</span><span id="line-338"></span><span>              </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682650"><span class="hs-identifier hs-var">filename</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe Int
</span><a href="#local-6989586621679682649"><span class="hs-identifier hs-var">mb_lineno</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-339"></span><span>                            </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679682633"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679682633"><span class="hs-identifier hs-var">lineno</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;:&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679682633"><span class="hs-identifier hs-var">lineno</span></a></span><span>
</span><span id="line-340"></span><span>                            </span><span class="annot"><span class="annottext">Maybe Int
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span>
</span><span id="line-341"></span><span>              </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;: &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682648"><span class="hs-identifier hs-var">msg</span></a></span><span>
</span><span id="line-342"></span><span>
</span><span id="line-343"></span><span id="local-6989586621679683188"><span class="annot"><a href="Distribution.Simple.Utils.html#die%27"><span class="hs-identifier hs-type">die'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621679683188"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-344"></span><span id="die%27"><span class="annot"><span class="annottext">die' :: forall a. Verbosity -&gt; String -&gt; IO a
</span><a href="Distribution.Simple.Utils.html#die%27"><span class="hs-identifier hs-var hs-var">die'</span></a></span></span><span> </span><span id="local-6989586621679682629"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682629"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679682628"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682628"><span class="hs-identifier hs-var">msg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HasCallStack =&gt; IO a) -&gt; IO a
forall a. HasCallStack =&gt; (HasCallStack =&gt; a) -&gt; a
</span><a href="../../base/src/GHC.Stack.html#withFrozenCallStack"><span class="hs-identifier hs-var">withFrozenCallStack</span></a></span><span> </span><span class="annot"><span class="annottext">((HasCallStack =&gt; IO a) -&gt; IO a) -&gt; (HasCallStack =&gt; IO a) -&gt; IO a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-345"></span><span>    </span><span id="local-6989586621679682622"><span class="annot"><span class="annottext">POSIXTime
</span><a href="#local-6989586621679682622"><span class="hs-identifier hs-var">ts</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO POSIXTime
</span><a href="../../time/src/Data.Time.Clock.POSIX.html#getPOSIXTime"><span class="hs-identifier hs-var">getPOSIXTime</span></a></span><span>
</span><span id="line-346"></span><span>    </span><span id="local-6989586621679682621"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682621"><span class="hs-identifier hs-var">pname</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO String
</span><a href="../../base/src/System.Environment.html#getProgName"><span class="hs-identifier hs-var">getProgName</span></a></span><span>
</span><span id="line-347"></span><span>    </span><span class="annot"><span class="annottext">IOException -&gt; IO a
forall a. IOException -&gt; IO a
</span><a href="../../base/src/GHC.IO.Exception.html#ioError"><span class="hs-identifier hs-var">ioError</span></a></span><span> </span><span class="annot"><span class="annottext">(IOException -&gt; IO a) -&gt; (String -&gt; IOException) -&gt; String -&gt; IO a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; IOException
</span><a href="Distribution.Simple.Utils.html#verbatimUserError"><span class="hs-identifier hs-var">verbatimUserError</span></a></span><span>
</span><span id="line-348"></span><span>            </span><span class="annot"><span class="annottext">(String -&gt; IOException)
-&gt; (String -&gt; String) -&gt; String -&gt; IOException
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">WithCallStack
  (POSIXTime
   -&gt; MarkWhen -&gt; TraceWhen -&gt; Verbosity -&gt; String -&gt; String)
POSIXTime -&gt; MarkWhen -&gt; TraceWhen -&gt; Verbosity -&gt; String -&gt; String
</span><a href="Distribution.Simple.Utils.html#withMetadata"><span class="hs-identifier hs-var">withMetadata</span></a></span><span> </span><span class="annot"><span class="annottext">POSIXTime
</span><a href="#local-6989586621679682622"><span class="hs-identifier hs-var">ts</span></a></span><span> </span><span class="annot"><span class="annottext">MarkWhen
</span><a href="Distribution.Simple.Utils.html#AlwaysMark"><span class="hs-identifier hs-var">AlwaysMark</span></a></span><span> </span><span class="annot"><span class="annottext">TraceWhen
</span><a href="Distribution.Simple.Utils.html#VerboseTrace"><span class="hs-identifier hs-var">VerboseTrace</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682629"><span class="hs-identifier hs-var">verbosity</span></a></span><span>
</span><span id="line-349"></span><span>            </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; (String -&gt; String) -&gt; String -&gt; String
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; String
</span><a href="Distribution.Simple.Utils.html#wrapTextVerbosity"><span class="hs-identifier hs-var">wrapTextVerbosity</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682629"><span class="hs-identifier hs-var">verbosity</span></a></span><span>
</span><span id="line-350"></span><span>            </span><span class="annot"><span class="annottext">(String -&gt; IO a) -&gt; String -&gt; IO a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682621"><span class="hs-identifier hs-var">pname</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;: &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682628"><span class="hs-identifier hs-var">msg</span></a></span><span>
</span><span id="line-351"></span><span>
</span><span id="line-352"></span><span id="local-6989586621679682620"><span class="annot"><a href="Distribution.Simple.Utils.html#dieNoWrap"><span class="hs-identifier hs-type">dieNoWrap</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621679682620"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-353"></span><span id="dieNoWrap"><span class="annot"><span class="annottext">dieNoWrap :: forall a. Verbosity -&gt; String -&gt; IO a
</span><a href="Distribution.Simple.Utils.html#dieNoWrap"><span class="hs-identifier hs-var hs-var">dieNoWrap</span></a></span></span><span> </span><span id="local-6989586621679682617"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682617"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679682616"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682616"><span class="hs-identifier hs-var">msg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HasCallStack =&gt; IO a) -&gt; IO a
forall a. HasCallStack =&gt; (HasCallStack =&gt; a) -&gt; a
</span><a href="../../base/src/GHC.Stack.html#withFrozenCallStack"><span class="hs-identifier hs-var">withFrozenCallStack</span></a></span><span> </span><span class="annot"><span class="annottext">((HasCallStack =&gt; IO a) -&gt; IO a) -&gt; (HasCallStack =&gt; IO a) -&gt; IO a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-354"></span><span>    </span><span class="hs-comment">-- TODO: should this have program name or not?</span><span>
</span><span id="line-355"></span><span>    </span><span id="local-6989586621679682611"><span class="annot"><span class="annottext">POSIXTime
</span><a href="#local-6989586621679682611"><span class="hs-identifier hs-var">ts</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO POSIXTime
</span><a href="../../time/src/Data.Time.Clock.POSIX.html#getPOSIXTime"><span class="hs-identifier hs-var">getPOSIXTime</span></a></span><span>
</span><span id="line-356"></span><span>    </span><span class="annot"><span class="annottext">IOException -&gt; IO a
forall a. IOException -&gt; IO a
</span><a href="../../base/src/GHC.IO.Exception.html#ioError"><span class="hs-identifier hs-var">ioError</span></a></span><span> </span><span class="annot"><span class="annottext">(IOException -&gt; IO a) -&gt; (String -&gt; IOException) -&gt; String -&gt; IO a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; IOException
</span><a href="Distribution.Simple.Utils.html#verbatimUserError"><span class="hs-identifier hs-var">verbatimUserError</span></a></span><span>
</span><span id="line-357"></span><span>            </span><span class="annot"><span class="annottext">(String -&gt; IOException)
-&gt; (String -&gt; String) -&gt; String -&gt; IOException
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">WithCallStack
  (POSIXTime
   -&gt; MarkWhen -&gt; TraceWhen -&gt; Verbosity -&gt; String -&gt; String)
POSIXTime -&gt; MarkWhen -&gt; TraceWhen -&gt; Verbosity -&gt; String -&gt; String
</span><a href="Distribution.Simple.Utils.html#withMetadata"><span class="hs-identifier hs-var">withMetadata</span></a></span><span> </span><span class="annot"><span class="annottext">POSIXTime
</span><a href="#local-6989586621679682611"><span class="hs-identifier hs-var">ts</span></a></span><span> </span><span class="annot"><span class="annottext">MarkWhen
</span><a href="Distribution.Simple.Utils.html#AlwaysMark"><span class="hs-identifier hs-var">AlwaysMark</span></a></span><span> </span><span class="annot"><span class="annottext">TraceWhen
</span><a href="Distribution.Simple.Utils.html#VerboseTrace"><span class="hs-identifier hs-var">VerboseTrace</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682617"><span class="hs-identifier hs-var">verbosity</span></a></span><span>
</span><span id="line-358"></span><span>            </span><span class="annot"><span class="annottext">(String -&gt; IO a) -&gt; String -&gt; IO a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682616"><span class="hs-identifier hs-var">msg</span></a></span><span>
</span><span id="line-359"></span><span>
</span><span id="line-360"></span><span class="hs-comment">-- | Given a block of IO code that may raise an exception, annotate</span><span>
</span><span id="line-361"></span><span class="hs-comment">-- it with the metadata from the current scope.  Use this as close</span><span>
</span><span id="line-362"></span><span class="hs-comment">-- to external code that raises IO exceptions as possible, since</span><span>
</span><span id="line-363"></span><span class="hs-comment">-- this function unconditionally wraps the error message with a trace</span><span>
</span><span id="line-364"></span><span class="hs-comment">-- (so it is NOT idempotent.)</span><span>
</span><span id="line-365"></span><span id="local-6989586621679683185"><span class="annot"><a href="Distribution.Simple.Utils.html#annotateIO"><span class="hs-identifier hs-type">annotateIO</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621679683185"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621679683185"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-366"></span><span id="annotateIO"><span class="annot"><span class="annottext">annotateIO :: forall a. Verbosity -&gt; IO a -&gt; IO a
</span><a href="Distribution.Simple.Utils.html#annotateIO"><span class="hs-identifier hs-var hs-var">annotateIO</span></a></span></span><span> </span><span id="local-6989586621679682607"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682607"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679682606"><span class="annot"><span class="annottext">IO a
</span><a href="#local-6989586621679682606"><span class="hs-identifier hs-var">act</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-367"></span><span>    </span><span id="local-6989586621679682605"><span class="annot"><span class="annottext">POSIXTime
</span><a href="#local-6989586621679682605"><span class="hs-identifier hs-var">ts</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO POSIXTime
</span><a href="../../time/src/Data.Time.Clock.POSIX.html#getPOSIXTime"><span class="hs-identifier hs-var">getPOSIXTime</span></a></span><span>
</span><span id="line-368"></span><span>    </span><span class="annot"><span class="annottext">(IOException -&gt; IOException) -&gt; IO a -&gt; IO a
forall a. (IOException -&gt; IOException) -&gt; IO a -&gt; IO a
</span><a href="../../base/src/System.IO.Error.html#modifyIOError"><span class="hs-identifier hs-var">modifyIOError</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">POSIXTime -&gt; IOException -&gt; IOException
</span><a href="#local-6989586621679682603"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">POSIXTime
</span><a href="#local-6989586621679682605"><span class="hs-identifier hs-var">ts</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">IO a
</span><a href="#local-6989586621679682606"><span class="hs-identifier hs-var">act</span></a></span><span>
</span><span id="line-369"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-370"></span><span>    </span><span id="local-6989586621679682603"><span class="annot"><span class="annottext">f :: POSIXTime -&gt; IOException -&gt; IOException
</span><a href="#local-6989586621679682603"><span class="hs-identifier hs-var hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679682602"><span class="annot"><span class="annottext">POSIXTime
</span><a href="#local-6989586621679682602"><span class="hs-identifier hs-var">ts</span></a></span></span><span> </span><span id="local-6989586621679682601"><span class="annot"><span class="annottext">IOException
</span><a href="#local-6989586621679682601"><span class="hs-identifier hs-var">ioe</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IOException -&gt; String -&gt; IOException
</span><a href="../../base/src/System.IO.Error.html#ioeSetErrorString"><span class="hs-identifier hs-var">ioeSetErrorString</span></a></span><span> </span><span class="annot"><span class="annottext">IOException
</span><a href="#local-6989586621679682601"><span class="hs-identifier hs-var">ioe</span></a></span><span>
</span><span id="line-371"></span><span>             </span><span class="annot"><span class="annottext">(String -&gt; IOException)
-&gt; (String -&gt; String) -&gt; String -&gt; IOException
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">WithCallStack
  (POSIXTime
   -&gt; MarkWhen -&gt; TraceWhen -&gt; Verbosity -&gt; String -&gt; String)
POSIXTime -&gt; MarkWhen -&gt; TraceWhen -&gt; Verbosity -&gt; String -&gt; String
</span><a href="Distribution.Simple.Utils.html#withMetadata"><span class="hs-identifier hs-var">withMetadata</span></a></span><span> </span><span class="annot"><span class="annottext">POSIXTime
</span><a href="#local-6989586621679682602"><span class="hs-identifier hs-var">ts</span></a></span><span> </span><span class="annot"><span class="annottext">MarkWhen
</span><a href="Distribution.Simple.Utils.html#NeverMark"><span class="hs-identifier hs-var">NeverMark</span></a></span><span> </span><span class="annot"><span class="annottext">TraceWhen
</span><a href="Distribution.Simple.Utils.html#VerboseTrace"><span class="hs-identifier hs-var">VerboseTrace</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682607"><span class="hs-identifier hs-var">verbosity</span></a></span><span>
</span><span id="line-372"></span><span>             </span><span class="annot"><span class="annottext">(String -&gt; IOException) -&gt; String -&gt; IOException
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">IOException -&gt; String
</span><a href="../../base/src/System.IO.Error.html#ioeGetErrorString"><span class="hs-identifier hs-var">ioeGetErrorString</span></a></span><span> </span><span class="annot"><span class="annottext">IOException
</span><a href="#local-6989586621679682601"><span class="hs-identifier hs-var">ioe</span></a></span><span>
</span><span id="line-373"></span><span>
</span><span id="line-374"></span><span>
</span><span id="line-375"></span><span class="hs-pragma">{-# NOINLINE</span><span> </span><span class="annot"><a href="Distribution.Simple.Utils.html#topHandlerWith"><span class="hs-pragma hs-type">topHandlerWith</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-376"></span><span class="annot"><a href="Distribution.Simple.Utils.html#topHandlerWith"><span class="hs-identifier hs-type">topHandlerWith</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621679683181"><span class="annot"><a href="#local-6989586621679683181"><span class="hs-identifier hs-type">a</span></a></span></span><span class="hs-operator">.</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Exception.Type.html#SomeException"><span class="hs-identifier hs-type">Exception.SomeException</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621679683181"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621679683181"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621679683181"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-377"></span><span id="topHandlerWith"><span class="annot"><span class="annottext">topHandlerWith :: forall a. (SomeException -&gt; IO a) -&gt; IO a -&gt; IO a
</span><a href="Distribution.Simple.Utils.html#topHandlerWith"><span class="hs-identifier hs-var hs-var">topHandlerWith</span></a></span></span><span> </span><span id="local-6989586621679682585"><span class="annot"><span class="annottext">SomeException -&gt; IO a
</span><a href="#local-6989586621679682585"><span class="hs-identifier hs-var">cont</span></a></span></span><span> </span><span id="local-6989586621679682584"><span class="annot"><span class="annottext">IO a
</span><a href="#local-6989586621679682584"><span class="hs-identifier hs-var">prog</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-378"></span><span>    </span><span class="hs-comment">-- By default, stderr to a terminal device is NoBuffering. But this</span><span>
</span><span id="line-379"></span><span>    </span><span class="hs-comment">-- is *really slow*</span><span>
</span><span id="line-380"></span><span>    </span><span class="annot"><span class="annottext">Handle -&gt; BufferMode -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.html#hSetBuffering"><span class="hs-identifier hs-var">hSetBuffering</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="../../base/src/GHC.IO.StdHandles.html#stderr"><span class="hs-identifier hs-var">stderr</span></a></span><span> </span><span class="annot"><span class="annottext">BufferMode
</span><a href="../../base/src/GHC.IO.Handle.Types.html#LineBuffering"><span class="hs-identifier hs-var">LineBuffering</span></a></span><span>
</span><span id="line-381"></span><span>    </span><span class="annot"><span class="annottext">IO a -&gt; [Handler a] -&gt; IO a
forall a. IO a -&gt; [Handler a] -&gt; IO a
</span><a href="../../base/src/Control.Exception.html#catches"><span class="hs-identifier hs-var">Exception.catches</span></a></span><span> </span><span class="annot"><span class="annottext">IO a
</span><a href="#local-6989586621679682584"><span class="hs-identifier hs-var">prog</span></a></span><span> </span><span class="hs-special">[</span><span>
</span><span id="line-382"></span><span>        </span><span class="annot"><span class="annottext">(AsyncException -&gt; IO a) -&gt; Handler a
forall a e. Exception e =&gt; (e -&gt; IO a) -&gt; Handler a
</span><a href="../../base/src/Control.Exception.html#Handler"><span class="hs-identifier hs-var">Exception.Handler</span></a></span><span> </span><span class="annot"><span class="annottext">AsyncException -&gt; IO a
</span><a href="#local-6989586621679682580"><span class="hs-identifier hs-var">rethrowAsyncExceptions</span></a></span><span>
</span><span id="line-383"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">(ExitCode -&gt; IO a) -&gt; Handler a
forall a e. Exception e =&gt; (e -&gt; IO a) -&gt; Handler a
</span><a href="../../base/src/Control.Exception.html#Handler"><span class="hs-identifier hs-var">Exception.Handler</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCode -&gt; IO a
</span><a href="#local-6989586621679682579"><span class="hs-identifier hs-var">rethrowExitStatus</span></a></span><span>
</span><span id="line-384"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">(SomeException -&gt; IO a) -&gt; Handler a
forall a e. Exception e =&gt; (e -&gt; IO a) -&gt; Handler a
</span><a href="../../base/src/Control.Exception.html#Handler"><span class="hs-identifier hs-var">Exception.Handler</span></a></span><span> </span><span class="annot"><span class="annottext">SomeException -&gt; IO a
</span><a href="#local-6989586621679682578"><span class="hs-identifier hs-var">handle</span></a></span><span>
</span><span id="line-385"></span><span>      </span><span class="hs-special">]</span><span>
</span><span id="line-386"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-387"></span><span>    </span><span class="hs-comment">-- Let async exceptions rise to the top for the default top-handler</span><span>
</span><span id="line-388"></span><span>    </span><span class="annot"><a href="#local-6989586621679682580"><span class="hs-identifier hs-type">rethrowAsyncExceptions</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Exception.html#AsyncException"><span class="hs-identifier hs-type">Exception.AsyncException</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621679683181"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-389"></span><span>    </span><span id="local-6989586621679682580"><span class="annot"><span class="annottext">rethrowAsyncExceptions :: AsyncException -&gt; IO a
</span><a href="#local-6989586621679682580"><span class="hs-identifier hs-var hs-var">rethrowAsyncExceptions</span></a></span></span><span> </span><span id="local-6989586621679682577"><span class="annot"><span class="annottext">AsyncException
</span><a href="#local-6989586621679682577"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">AsyncException -&gt; IO a
forall e a. Exception e =&gt; e -&gt; IO a
</span><a href="../../base/src/GHC.IO.html#throwIO"><span class="hs-identifier hs-var">throwIO</span></a></span><span> </span><span class="annot"><span class="annottext">AsyncException
</span><a href="#local-6989586621679682577"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-390"></span><span>
</span><span id="line-391"></span><span>    </span><span class="hs-comment">-- ExitCode gets thrown asynchronously too, and we don't want to print it</span><span>
</span><span id="line-392"></span><span>    </span><span class="annot"><a href="#local-6989586621679682579"><span class="hs-identifier hs-type">rethrowExitStatus</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Exception.html#ExitCode"><span class="hs-identifier hs-type">ExitCode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621679683181"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-393"></span><span>    </span><span id="local-6989586621679682579"><span class="annot"><span class="annottext">rethrowExitStatus :: ExitCode -&gt; IO a
</span><a href="#local-6989586621679682579"><span class="hs-identifier hs-var hs-var">rethrowExitStatus</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ExitCode -&gt; IO a
forall e a. Exception e =&gt; e -&gt; IO a
</span><a href="../../base/src/GHC.IO.html#throwIO"><span class="hs-identifier hs-var">throwIO</span></a></span><span>
</span><span id="line-394"></span><span>
</span><span id="line-395"></span><span>    </span><span class="hs-comment">-- Print all other exceptions</span><span>
</span><span id="line-396"></span><span>    </span><span class="annot"><a href="#local-6989586621679682578"><span class="hs-identifier hs-type">handle</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Exception.Type.html#SomeException"><span class="hs-identifier hs-type">Exception.SomeException</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621679683181"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-397"></span><span>    </span><span id="local-6989586621679682578"><span class="annot"><span class="annottext">handle :: SomeException -&gt; IO a
</span><a href="#local-6989586621679682578"><span class="hs-identifier hs-var hs-var">handle</span></a></span></span><span> </span><span id="local-6989586621679682575"><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621679682575"><span class="hs-identifier hs-var">se</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-398"></span><span>      </span><span class="annot"><span class="annottext">Handle -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.html#hFlush"><span class="hs-identifier hs-var">hFlush</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="../../base/src/GHC.IO.StdHandles.html#stdout"><span class="hs-identifier hs-var">stdout</span></a></span><span>
</span><span id="line-399"></span><span>      </span><span id="local-6989586621679682574"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682574"><span class="hs-identifier hs-var">pname</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO String
</span><a href="../../base/src/System.Environment.html#getProgName"><span class="hs-identifier hs-var">getProgName</span></a></span><span>
</span><span id="line-400"></span><span>      </span><span class="annot"><span class="annottext">Handle -&gt; String -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.Text.html#hPutStr"><span class="hs-identifier hs-var">hPutStr</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="../../base/src/GHC.IO.StdHandles.html#stderr"><span class="hs-identifier hs-var">stderr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SomeException -&gt; String
</span><a href="#local-6989586621679682573"><span class="hs-identifier hs-var">message</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682574"><span class="hs-identifier hs-var">pname</span></a></span><span> </span><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621679682575"><span class="hs-identifier hs-var">se</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-401"></span><span>      </span><span class="annot"><span class="annottext">SomeException -&gt; IO a
</span><a href="#local-6989586621679682585"><span class="hs-identifier hs-var">cont</span></a></span><span> </span><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621679682575"><span class="hs-identifier hs-var">se</span></a></span><span>
</span><span id="line-402"></span><span>
</span><span id="line-403"></span><span>    </span><span class="annot"><a href="#local-6989586621679682573"><span class="hs-identifier hs-type">message</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Exception.Type.html#SomeException"><span class="hs-identifier hs-type">Exception.SomeException</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-404"></span><span>    </span><span id="local-6989586621679682573"><span class="annot"><span class="annottext">message :: String -&gt; SomeException -&gt; String
</span><a href="#local-6989586621679682573"><span class="hs-identifier hs-var hs-var">message</span></a></span></span><span> </span><span id="local-6989586621679682572"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682572"><span class="hs-identifier hs-var">pname</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Exception.Type.html#SomeException"><span class="hs-identifier hs-type">Exception.SomeException</span></a></span><span> </span><span id="local-6989586621679682564"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679682564"><span class="hs-identifier hs-var">se</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-405"></span><span>      </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">e -&gt; Maybe IOException
forall a b. (Typeable a, Typeable b) =&gt; a -&gt; Maybe b
</span><a href="../../base/src/Data.Typeable.html#cast"><span class="hs-identifier hs-var">cast</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679682564"><span class="hs-identifier hs-var">se</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Exception.html#IOException"><span class="hs-identifier hs-type">Exception.IOException</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-406"></span><span>        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679682563"><span class="annot"><span class="annottext">IOException
</span><a href="#local-6989586621679682563"><span class="hs-identifier hs-var">ioe</span></a></span></span><span>
</span><span id="line-407"></span><span>         </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">IOException -&gt; Bool
</span><a href="Distribution.Simple.Utils.html#ioeGetVerbatim"><span class="hs-identifier hs-var">ioeGetVerbatim</span></a></span><span> </span><span class="annot"><span class="annottext">IOException
</span><a href="#local-6989586621679682563"><span class="hs-identifier hs-var">ioe</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-408"></span><span>            </span><span class="hs-comment">-- Use the message verbatim</span><span>
</span><span id="line-409"></span><span>            </span><span class="annot"><span class="annottext">IOException -&gt; String
</span><a href="../../base/src/System.IO.Error.html#ioeGetErrorString"><span class="hs-identifier hs-var">ioeGetErrorString</span></a></span><span> </span><span class="annot"><span class="annottext">IOException
</span><a href="#local-6989586621679682563"><span class="hs-identifier hs-var">ioe</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;\n&quot;</span></span><span>
</span><span id="line-410"></span><span>         </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">IOException -&gt; Bool
</span><a href="../../base/src/System.IO.Error.html#isUserError"><span class="hs-identifier hs-var">isUserError</span></a></span><span> </span><span class="annot"><span class="annottext">IOException
</span><a href="#local-6989586621679682563"><span class="hs-identifier hs-var">ioe</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-411"></span><span>          </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679682561"><span class="annot"><span class="annottext">file :: String
</span><a href="#local-6989586621679682561"><span class="hs-identifier hs-var hs-var">file</span></a></span></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">IOException -&gt; Maybe String
</span><a href="../../base/src/System.IO.Error.html#ioeGetFileName"><span class="hs-identifier hs-var">ioeGetFileName</span></a></span><span> </span><span class="annot"><span class="annottext">IOException
</span><a href="#local-6989586621679682563"><span class="hs-identifier hs-var">ioe</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-412"></span><span>                               </span><span class="annot"><span class="annottext">Maybe String
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-413"></span><span>                               </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679682559"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682559"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682559"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682558"><span class="hs-identifier hs-var">location</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;: &quot;</span></span><span>
</span><span id="line-414"></span><span>              </span><span id="local-6989586621679682558"><span class="annot"><span class="annottext">location :: String
</span><a href="#local-6989586621679682558"><span class="hs-identifier hs-var hs-var">location</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">IOException -&gt; String
</span><a href="../../base/src/System.IO.Error.html#ioeGetLocation"><span class="hs-identifier hs-var">ioeGetLocation</span></a></span><span> </span><span class="annot"><span class="annottext">IOException
</span><a href="#local-6989586621679682563"><span class="hs-identifier hs-var">ioe</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-415"></span><span>                               </span><span id="local-6989586621679682557"><span class="annot"><span class="annottext">l :: String
</span><a href="#local-6989586621679682557"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span id="local-6989586621679682556"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679682556"><span class="hs-identifier hs-var">n</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="../../base/src/GHC.Unicode.html#isDigit"><span class="hs-identifier hs-var">isDigit</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679682556"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">':'</span></span><span> </span><span class="annot"><span class="annottext">Char -&gt; String -&gt; String
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682557"><span class="hs-identifier hs-var">l</span></a></span><span>
</span><span id="line-416"></span><span>                               </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span>                        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-417"></span><span>              </span><span id="local-6989586621679682554"><span class="annot"><span class="annottext">detail :: String
</span><a href="#local-6989586621679682554"><span class="hs-identifier hs-var hs-var">detail</span></a></span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IOException -&gt; String
</span><a href="../../base/src/System.IO.Error.html#ioeGetErrorString"><span class="hs-identifier hs-var">ioeGetErrorString</span></a></span><span> </span><span class="annot"><span class="annottext">IOException
</span><a href="#local-6989586621679682563"><span class="hs-identifier hs-var">ioe</span></a></span><span>
</span><span id="line-418"></span><span>          </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="Distribution.Utils.Generic.html#wrapText"><span class="hs-identifier hs-var">wrapText</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682572"><span class="hs-identifier hs-var">pname</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;: &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682561"><span class="hs-identifier hs-var">file</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682554"><span class="hs-identifier hs-var">detail</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-419"></span><span>        </span><span class="annot"><span class="annottext">Maybe IOException
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-420"></span><span>          </span><span class="annot"><span class="annottext">e -&gt; String
forall e. Exception e =&gt; e -&gt; String
</span><a href="Distribution.Simple.Utils.html#displaySomeException"><span class="hs-identifier hs-var">displaySomeException</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679682564"><span class="hs-identifier hs-var">se</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;\n&quot;</span></span><span>
</span><span id="line-421"></span><span>
</span><span id="line-422"></span><span class="hs-comment">-- | BC wrapper around 'Exception.displayException'.</span><span>
</span><span id="line-423"></span><span id="local-6989586621679683165"><span class="annot"><a href="Distribution.Simple.Utils.html#displaySomeException"><span class="hs-identifier hs-type">displaySomeException</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Exception.Type.html#Exception"><span class="hs-identifier hs-type">Exception.Exception</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679683165"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679683165"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span></span><span>
</span><span id="line-424"></span><span id="displaySomeException"><span class="annot"><span class="annottext">displaySomeException :: forall e. Exception e =&gt; e -&gt; String
</span><a href="Distribution.Simple.Utils.html#displaySomeException"><span class="hs-identifier hs-var hs-var">displaySomeException</span></a></span></span><span> </span><span id="local-6989586621679682550"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679682550"><span class="hs-identifier hs-var">se</span></a></span></span><span> </span><span class="hs-glyph">=</span><span class="hs-cpp">
#if __GLASGOW_HASKELL__ &lt; 710
</span><span>    </span><span class="hs-identifier">show</span><span> </span><span class="hs-identifier">se</span><span class="hs-cpp">
#else
</span><span>    </span><span class="annot"><span class="annottext">e -&gt; String
forall e. Exception e =&gt; e -&gt; String
</span><a href="../../base/src/GHC.Exception.Type.html#displayException"><span class="hs-identifier hs-var">Exception.displayException</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679682550"><span class="hs-identifier hs-var">se</span></a></span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-431"></span><span id="local-6989586621679683163"><span class="annot"><a href="Distribution.Simple.Utils.html#topHandler"><span class="hs-identifier hs-type">topHandler</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621679683163"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621679683163"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-432"></span><span id="topHandler"><span class="annot"><span class="annottext">topHandler :: forall a. IO a -&gt; IO a
</span><a href="Distribution.Simple.Utils.html#topHandler"><span class="hs-identifier hs-var hs-var">topHandler</span></a></span></span><span> </span><span id="local-6989586621679682548"><span class="annot"><span class="annottext">IO a
</span><a href="#local-6989586621679682548"><span class="hs-identifier hs-var">prog</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(SomeException -&gt; IO a) -&gt; IO a -&gt; IO a
forall a. (SomeException -&gt; IO a) -&gt; IO a -&gt; IO a
</span><a href="Distribution.Simple.Utils.html#topHandlerWith"><span class="hs-identifier hs-var">topHandlerWith</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IO a -&gt; SomeException -&gt; IO a
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="annot"><span class="annottext">(IO a -&gt; SomeException -&gt; IO a) -&gt; IO a -&gt; SomeException -&gt; IO a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCode -&gt; IO a
forall a. ExitCode -&gt; IO a
</span><a href="../../base/src/System.Exit.html#exitWith"><span class="hs-identifier hs-var">exitWith</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; ExitCode
</span><a href="../../base/src/GHC.IO.Exception.html#ExitFailure"><span class="hs-identifier hs-var">ExitFailure</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">IO a
</span><a href="#local-6989586621679682548"><span class="hs-identifier hs-var">prog</span></a></span><span>
</span><span id="line-433"></span><span>
</span><span id="line-434"></span><span class="annot"><a href="Distribution.Simple.Utils.html#verbosityHandle"><span class="hs-identifier hs-type">verbosityHandle</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Types.html#Handle"><span class="hs-identifier hs-type">Handle</span></a></span><span>
</span><span id="line-435"></span><span id="verbosityHandle"><span class="annot"><span class="annottext">verbosityHandle :: Verbosity -&gt; Handle
</span><a href="Distribution.Simple.Utils.html#verbosityHandle"><span class="hs-identifier hs-var hs-var">verbosityHandle</span></a></span></span><span> </span><span id="local-6989586621679682543"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682543"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span>
</span><span id="line-436"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; Bool
</span><a href="Distribution.Verbosity.html#isVerboseStderr"><span class="hs-identifier hs-var">isVerboseStderr</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682543"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="../../base/src/GHC.IO.StdHandles.html#stderr"><span class="hs-identifier hs-var">stderr</span></a></span><span>
</span><span id="line-437"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>                 </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="../../base/src/GHC.IO.StdHandles.html#stdout"><span class="hs-identifier hs-var">stdout</span></a></span><span>
</span><span id="line-438"></span><span>
</span><span id="line-439"></span><span class="hs-comment">-- | Non fatal conditions that may be indicative of an error or problem.</span><span>
</span><span id="line-440"></span><span class="hs-comment">--</span><span>
</span><span id="line-441"></span><span class="hs-comment">-- We display these at the 'normal' verbosity level.</span><span>
</span><span id="line-442"></span><span class="hs-comment">--</span><span>
</span><span id="line-443"></span><span class="annot"><a href="Distribution.Simple.Utils.html#warn"><span class="hs-identifier hs-type">warn</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-444"></span><span id="warn"><span class="annot"><span class="annottext">warn :: Verbosity -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#warn"><span class="hs-identifier hs-var hs-var">warn</span></a></span></span><span> </span><span id="local-6989586621679682541"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682541"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679682540"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682540"><span class="hs-identifier hs-var">msg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HasCallStack =&gt; IO ()) -&gt; IO ()
forall a. HasCallStack =&gt; (HasCallStack =&gt; a) -&gt; a
</span><a href="../../base/src/GHC.Stack.html#withFrozenCallStack"><span class="hs-identifier hs-var">withFrozenCallStack</span></a></span><span> </span><span class="annot"><span class="annottext">((HasCallStack =&gt; IO ()) -&gt; IO ())
-&gt; (HasCallStack =&gt; IO ()) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-445"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682541"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; Verbosity -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="Distribution.Verbosity.html#normal"><span class="hs-identifier hs-var">normal</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-446"></span><span>    </span><span id="local-6989586621679682530"><span class="annot"><span class="annottext">POSIXTime
</span><a href="#local-6989586621679682530"><span class="hs-identifier hs-var">ts</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO POSIXTime
</span><a href="../../time/src/Data.Time.Clock.POSIX.html#getPOSIXTime"><span class="hs-identifier hs-var">getPOSIXTime</span></a></span><span>
</span><span id="line-447"></span><span>    </span><span class="annot"><span class="annottext">Handle -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.html#hFlush"><span class="hs-identifier hs-var">hFlush</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="../../base/src/GHC.IO.StdHandles.html#stdout"><span class="hs-identifier hs-var">stdout</span></a></span><span>
</span><span id="line-448"></span><span>    </span><span class="annot"><span class="annottext">Handle -&gt; String -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.Text.html#hPutStr"><span class="hs-identifier hs-var">hPutStr</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="../../base/src/GHC.IO.StdHandles.html#stderr"><span class="hs-identifier hs-var">stderr</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; IO ()) -&gt; (String -&gt; String) -&gt; String -&gt; IO ()
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">WithCallStack
  (POSIXTime
   -&gt; MarkWhen -&gt; TraceWhen -&gt; Verbosity -&gt; String -&gt; String)
POSIXTime -&gt; MarkWhen -&gt; TraceWhen -&gt; Verbosity -&gt; String -&gt; String
</span><a href="Distribution.Simple.Utils.html#withMetadata"><span class="hs-identifier hs-var">withMetadata</span></a></span><span> </span><span class="annot"><span class="annottext">POSIXTime
</span><a href="#local-6989586621679682530"><span class="hs-identifier hs-var">ts</span></a></span><span> </span><span class="annot"><span class="annottext">MarkWhen
</span><a href="Distribution.Simple.Utils.html#NormalMark"><span class="hs-identifier hs-var">NormalMark</span></a></span><span> </span><span class="annot"><span class="annottext">TraceWhen
</span><a href="Distribution.Simple.Utils.html#FlagTrace"><span class="hs-identifier hs-var">FlagTrace</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682541"><span class="hs-identifier hs-var">verbosity</span></a></span><span>
</span><span id="line-449"></span><span>                   </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; (String -&gt; String) -&gt; String -&gt; String
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; String
</span><a href="Distribution.Simple.Utils.html#wrapTextVerbosity"><span class="hs-identifier hs-var">wrapTextVerbosity</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682541"><span class="hs-identifier hs-var">verbosity</span></a></span><span>
</span><span id="line-450"></span><span>                   </span><span class="annot"><span class="annottext">(String -&gt; IO ()) -&gt; String -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Warning: &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682540"><span class="hs-identifier hs-var">msg</span></a></span><span>
</span><span id="line-451"></span><span>
</span><span id="line-452"></span><span class="hs-comment">-- | Useful status messages.</span><span>
</span><span id="line-453"></span><span class="hs-comment">--</span><span>
</span><span id="line-454"></span><span class="hs-comment">-- We display these at the 'normal' verbosity level.</span><span>
</span><span id="line-455"></span><span class="hs-comment">--</span><span>
</span><span id="line-456"></span><span class="hs-comment">-- This is for the ordinary helpful status messages that users see. Just</span><span>
</span><span id="line-457"></span><span class="hs-comment">-- enough information to know that things are working but not floods of detail.</span><span>
</span><span id="line-458"></span><span class="hs-comment">--</span><span>
</span><span id="line-459"></span><span class="annot"><a href="Distribution.Simple.Utils.html#notice"><span class="hs-identifier hs-type">notice</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-460"></span><span id="notice"><span class="annot"><span class="annottext">notice :: Verbosity -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#notice"><span class="hs-identifier hs-var hs-var">notice</span></a></span></span><span> </span><span id="local-6989586621679682527"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682527"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679682526"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682526"><span class="hs-identifier hs-var">msg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HasCallStack =&gt; IO ()) -&gt; IO ()
forall a. HasCallStack =&gt; (HasCallStack =&gt; a) -&gt; a
</span><a href="../../base/src/GHC.Stack.html#withFrozenCallStack"><span class="hs-identifier hs-var">withFrozenCallStack</span></a></span><span> </span><span class="annot"><span class="annottext">((HasCallStack =&gt; IO ()) -&gt; IO ())
-&gt; (HasCallStack =&gt; IO ()) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-461"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682527"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; Verbosity -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="Distribution.Verbosity.html#normal"><span class="hs-identifier hs-var">normal</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-462"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679682519"><span class="annot"><span class="annottext">h :: Handle
</span><a href="#local-6989586621679682519"><span class="hs-identifier hs-var hs-var">h</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; Handle
</span><a href="Distribution.Simple.Utils.html#verbosityHandle"><span class="hs-identifier hs-var">verbosityHandle</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682527"><span class="hs-identifier hs-var">verbosity</span></a></span><span>
</span><span id="line-463"></span><span>    </span><span id="local-6989586621679682518"><span class="annot"><span class="annottext">POSIXTime
</span><a href="#local-6989586621679682518"><span class="hs-identifier hs-var">ts</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO POSIXTime
</span><a href="../../time/src/Data.Time.Clock.POSIX.html#getPOSIXTime"><span class="hs-identifier hs-var">getPOSIXTime</span></a></span><span>
</span><span id="line-464"></span><span>    </span><span class="annot"><span class="annottext">Handle -&gt; String -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.Text.html#hPutStr"><span class="hs-identifier hs-var">hPutStr</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679682519"><span class="hs-identifier hs-var">h</span></a></span><span>
</span><span id="line-465"></span><span>        </span><span class="annot"><span class="annottext">(String -&gt; IO ()) -&gt; String -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">WithCallStack
  (POSIXTime
   -&gt; MarkWhen -&gt; TraceWhen -&gt; Verbosity -&gt; String -&gt; String)
POSIXTime -&gt; MarkWhen -&gt; TraceWhen -&gt; Verbosity -&gt; String -&gt; String
</span><a href="Distribution.Simple.Utils.html#withMetadata"><span class="hs-identifier hs-var">withMetadata</span></a></span><span> </span><span class="annot"><span class="annottext">POSIXTime
</span><a href="#local-6989586621679682518"><span class="hs-identifier hs-var">ts</span></a></span><span> </span><span class="annot"><span class="annottext">MarkWhen
</span><a href="Distribution.Simple.Utils.html#NormalMark"><span class="hs-identifier hs-var">NormalMark</span></a></span><span> </span><span class="annot"><span class="annottext">TraceWhen
</span><a href="Distribution.Simple.Utils.html#FlagTrace"><span class="hs-identifier hs-var">FlagTrace</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682527"><span class="hs-identifier hs-var">verbosity</span></a></span><span>
</span><span id="line-466"></span><span>        </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; String -&gt; String
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; String
</span><a href="Distribution.Simple.Utils.html#wrapTextVerbosity"><span class="hs-identifier hs-var">wrapTextVerbosity</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682527"><span class="hs-identifier hs-var">verbosity</span></a></span><span>
</span><span id="line-467"></span><span>        </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; String -&gt; String
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682526"><span class="hs-identifier hs-var">msg</span></a></span><span>
</span><span id="line-468"></span><span>
</span><span id="line-469"></span><span class="hs-comment">-- | Display a message at 'normal' verbosity level, but without</span><span>
</span><span id="line-470"></span><span class="hs-comment">-- wrapping.</span><span>
</span><span id="line-471"></span><span class="hs-comment">--</span><span>
</span><span id="line-472"></span><span class="annot"><a href="Distribution.Simple.Utils.html#noticeNoWrap"><span class="hs-identifier hs-type">noticeNoWrap</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-473"></span><span id="noticeNoWrap"><span class="annot"><span class="annottext">noticeNoWrap :: Verbosity -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#noticeNoWrap"><span class="hs-identifier hs-var hs-var">noticeNoWrap</span></a></span></span><span> </span><span id="local-6989586621679682517"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682517"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679682516"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682516"><span class="hs-identifier hs-var">msg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HasCallStack =&gt; IO ()) -&gt; IO ()
forall a. HasCallStack =&gt; (HasCallStack =&gt; a) -&gt; a
</span><a href="../../base/src/GHC.Stack.html#withFrozenCallStack"><span class="hs-identifier hs-var">withFrozenCallStack</span></a></span><span> </span><span class="annot"><span class="annottext">((HasCallStack =&gt; IO ()) -&gt; IO ())
-&gt; (HasCallStack =&gt; IO ()) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-474"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682517"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; Verbosity -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="Distribution.Verbosity.html#normal"><span class="hs-identifier hs-var">normal</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-475"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679682509"><span class="annot"><span class="annottext">h :: Handle
</span><a href="#local-6989586621679682509"><span class="hs-identifier hs-var hs-var">h</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; Handle
</span><a href="Distribution.Simple.Utils.html#verbosityHandle"><span class="hs-identifier hs-var">verbosityHandle</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682517"><span class="hs-identifier hs-var">verbosity</span></a></span><span>
</span><span id="line-476"></span><span>    </span><span id="local-6989586621679682508"><span class="annot"><span class="annottext">POSIXTime
</span><a href="#local-6989586621679682508"><span class="hs-identifier hs-var">ts</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO POSIXTime
</span><a href="../../time/src/Data.Time.Clock.POSIX.html#getPOSIXTime"><span class="hs-identifier hs-var">getPOSIXTime</span></a></span><span>
</span><span id="line-477"></span><span>    </span><span class="annot"><span class="annottext">Handle -&gt; String -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.Text.html#hPutStr"><span class="hs-identifier hs-var">hPutStr</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679682509"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; IO ()) -&gt; (String -&gt; String) -&gt; String -&gt; IO ()
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">WithCallStack
  (POSIXTime
   -&gt; MarkWhen -&gt; TraceWhen -&gt; Verbosity -&gt; String -&gt; String)
POSIXTime -&gt; MarkWhen -&gt; TraceWhen -&gt; Verbosity -&gt; String -&gt; String
</span><a href="Distribution.Simple.Utils.html#withMetadata"><span class="hs-identifier hs-var">withMetadata</span></a></span><span> </span><span class="annot"><span class="annottext">POSIXTime
</span><a href="#local-6989586621679682508"><span class="hs-identifier hs-var">ts</span></a></span><span> </span><span class="annot"><span class="annottext">MarkWhen
</span><a href="Distribution.Simple.Utils.html#NormalMark"><span class="hs-identifier hs-var">NormalMark</span></a></span><span> </span><span class="annot"><span class="annottext">TraceWhen
</span><a href="Distribution.Simple.Utils.html#FlagTrace"><span class="hs-identifier hs-var">FlagTrace</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682517"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; IO ()) -&gt; String -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682516"><span class="hs-identifier hs-var">msg</span></a></span><span>
</span><span id="line-478"></span><span>
</span><span id="line-479"></span><span class="hs-comment">-- | Pretty-print a 'Disp.Doc' status message at 'normal' verbosity</span><span>
</span><span id="line-480"></span><span class="hs-comment">-- level.  Use this if you need fancy formatting.</span><span>
</span><span id="line-481"></span><span class="hs-comment">--</span><span>
</span><span id="line-482"></span><span class="annot"><a href="Distribution.Simple.Utils.html#noticeDoc"><span class="hs-identifier hs-type">noticeDoc</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../pretty/src/Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Disp.Doc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-483"></span><span id="noticeDoc"><span class="annot"><span class="annottext">noticeDoc :: Verbosity -&gt; Doc -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#noticeDoc"><span class="hs-identifier hs-var hs-var">noticeDoc</span></a></span></span><span> </span><span id="local-6989586621679682507"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682507"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679682506"><span class="annot"><span class="annottext">Doc
</span><a href="#local-6989586621679682506"><span class="hs-identifier hs-var">msg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HasCallStack =&gt; IO ()) -&gt; IO ()
forall a. HasCallStack =&gt; (HasCallStack =&gt; a) -&gt; a
</span><a href="../../base/src/GHC.Stack.html#withFrozenCallStack"><span class="hs-identifier hs-var">withFrozenCallStack</span></a></span><span> </span><span class="annot"><span class="annottext">((HasCallStack =&gt; IO ()) -&gt; IO ())
-&gt; (HasCallStack =&gt; IO ()) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-484"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682507"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; Verbosity -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="Distribution.Verbosity.html#normal"><span class="hs-identifier hs-var">normal</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-485"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679682499"><span class="annot"><span class="annottext">h :: Handle
</span><a href="#local-6989586621679682499"><span class="hs-identifier hs-var hs-var">h</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; Handle
</span><a href="Distribution.Simple.Utils.html#verbosityHandle"><span class="hs-identifier hs-var">verbosityHandle</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682507"><span class="hs-identifier hs-var">verbosity</span></a></span><span>
</span><span id="line-486"></span><span>    </span><span id="local-6989586621679682498"><span class="annot"><span class="annottext">POSIXTime
</span><a href="#local-6989586621679682498"><span class="hs-identifier hs-var">ts</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO POSIXTime
</span><a href="../../time/src/Data.Time.Clock.POSIX.html#getPOSIXTime"><span class="hs-identifier hs-var">getPOSIXTime</span></a></span><span>
</span><span id="line-487"></span><span>    </span><span class="annot"><span class="annottext">Handle -&gt; String -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.Text.html#hPutStr"><span class="hs-identifier hs-var">hPutStr</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679682499"><span class="hs-identifier hs-var">h</span></a></span><span>
</span><span id="line-488"></span><span>        </span><span class="annot"><span class="annottext">(String -&gt; IO ()) -&gt; String -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">WithCallStack
  (POSIXTime
   -&gt; MarkWhen -&gt; TraceWhen -&gt; Verbosity -&gt; String -&gt; String)
POSIXTime -&gt; MarkWhen -&gt; TraceWhen -&gt; Verbosity -&gt; String -&gt; String
</span><a href="Distribution.Simple.Utils.html#withMetadata"><span class="hs-identifier hs-var">withMetadata</span></a></span><span> </span><span class="annot"><span class="annottext">POSIXTime
</span><a href="#local-6989586621679682498"><span class="hs-identifier hs-var">ts</span></a></span><span> </span><span class="annot"><span class="annottext">MarkWhen
</span><a href="Distribution.Simple.Utils.html#NormalMark"><span class="hs-identifier hs-var">NormalMark</span></a></span><span> </span><span class="annot"><span class="annottext">TraceWhen
</span><a href="Distribution.Simple.Utils.html#FlagTrace"><span class="hs-identifier hs-var">FlagTrace</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682507"><span class="hs-identifier hs-var">verbosity</span></a></span><span>
</span><span id="line-489"></span><span>        </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; String -&gt; String
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Style -&gt; Doc -&gt; String
</span><a href="../../pretty/src/Text.PrettyPrint.HughesPJ.html#renderStyle"><span class="hs-identifier hs-var">Disp.renderStyle</span></a></span><span> </span><span class="annot"><span class="annottext">Style
</span><a href="Distribution.Pretty.html#defaultStyle"><span class="hs-identifier hs-var">defaultStyle</span></a></span><span>
</span><span id="line-490"></span><span>        </span><span class="annot"><span class="annottext">(Doc -&gt; String) -&gt; Doc -&gt; String
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Doc
</span><a href="#local-6989586621679682506"><span class="hs-identifier hs-var">msg</span></a></span><span>
</span><span id="line-491"></span><span>
</span><span id="line-492"></span><span class="hs-comment">-- | Display a &quot;setup status message&quot;.  Prefer using setupMessage'</span><span>
</span><span id="line-493"></span><span class="hs-comment">-- if possible.</span><span>
</span><span id="line-494"></span><span class="hs-comment">--</span><span>
</span><span id="line-495"></span><span class="annot"><a href="Distribution.Simple.Utils.html#setupMessage"><span class="hs-identifier hs-type">setupMessage</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Types.PackageId.html#PackageIdentifier"><span class="hs-identifier hs-type">PackageIdentifier</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-496"></span><span id="setupMessage"><span class="annot"><span class="annottext">setupMessage :: Verbosity -&gt; String -&gt; PackageIdentifier -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#setupMessage"><span class="hs-identifier hs-var hs-var">setupMessage</span></a></span></span><span> </span><span id="local-6989586621679682495"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682495"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679682494"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682494"><span class="hs-identifier hs-var">msg</span></a></span></span><span> </span><span id="local-6989586621679682493"><span class="annot"><span class="annottext">PackageIdentifier
</span><a href="#local-6989586621679682493"><span class="hs-identifier hs-var">pkgid</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HasCallStack =&gt; IO ()) -&gt; IO ()
forall a. HasCallStack =&gt; (HasCallStack =&gt; a) -&gt; a
</span><a href="../../base/src/GHC.Stack.html#withFrozenCallStack"><span class="hs-identifier hs-var">withFrozenCallStack</span></a></span><span> </span><span class="annot"><span class="annottext">((HasCallStack =&gt; IO ()) -&gt; IO ())
-&gt; (HasCallStack =&gt; IO ()) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-497"></span><span>    </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#noticeNoWrap"><span class="hs-identifier hs-var">noticeNoWrap</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682495"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682494"><span class="hs-identifier hs-var">msg</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">' '</span></span><span class="annot"><span class="annottext">Char -&gt; String -&gt; String
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">PackageIdentifier -&gt; String
forall a. Pretty a =&gt; a -&gt; String
</span><a href="Distribution.Pretty.html#prettyShow"><span class="hs-identifier hs-var">prettyShow</span></a></span><span> </span><span class="annot"><span class="annottext">PackageIdentifier
</span><a href="#local-6989586621679682493"><span class="hs-identifier hs-var">pkgid</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;...&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-498"></span><span>
</span><span id="line-499"></span><span class="hs-comment">-- | More detail on the operation of some action.</span><span>
</span><span id="line-500"></span><span class="hs-comment">--</span><span>
</span><span id="line-501"></span><span class="hs-comment">-- We display these messages when the verbosity level is 'verbose'</span><span>
</span><span id="line-502"></span><span class="hs-comment">--</span><span>
</span><span id="line-503"></span><span class="annot"><a href="Distribution.Simple.Utils.html#info"><span class="hs-identifier hs-type">info</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-504"></span><span id="info"><span class="annot"><span class="annottext">info :: Verbosity -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#info"><span class="hs-identifier hs-var hs-var">info</span></a></span></span><span> </span><span id="local-6989586621679682488"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682488"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679682487"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682487"><span class="hs-identifier hs-var">msg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HasCallStack =&gt; IO ()) -&gt; IO ()
forall a. HasCallStack =&gt; (HasCallStack =&gt; a) -&gt; a
</span><a href="../../base/src/GHC.Stack.html#withFrozenCallStack"><span class="hs-identifier hs-var">withFrozenCallStack</span></a></span><span> </span><span class="annot"><span class="annottext">((HasCallStack =&gt; IO ()) -&gt; IO ())
-&gt; (HasCallStack =&gt; IO ()) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-505"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682488"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; Verbosity -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="Distribution.Verbosity.html#verbose"><span class="hs-identifier hs-var">verbose</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-506"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679682479"><span class="annot"><span class="annottext">h :: Handle
</span><a href="#local-6989586621679682479"><span class="hs-identifier hs-var hs-var">h</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; Handle
</span><a href="Distribution.Simple.Utils.html#verbosityHandle"><span class="hs-identifier hs-var">verbosityHandle</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682488"><span class="hs-identifier hs-var">verbosity</span></a></span><span>
</span><span id="line-507"></span><span>    </span><span id="local-6989586621679682478"><span class="annot"><span class="annottext">POSIXTime
</span><a href="#local-6989586621679682478"><span class="hs-identifier hs-var">ts</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO POSIXTime
</span><a href="../../time/src/Data.Time.Clock.POSIX.html#getPOSIXTime"><span class="hs-identifier hs-var">getPOSIXTime</span></a></span><span>
</span><span id="line-508"></span><span>    </span><span class="annot"><span class="annottext">Handle -&gt; String -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.Text.html#hPutStr"><span class="hs-identifier hs-var">hPutStr</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679682479"><span class="hs-identifier hs-var">h</span></a></span><span>
</span><span id="line-509"></span><span>        </span><span class="annot"><span class="annottext">(String -&gt; IO ()) -&gt; String -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">WithCallStack
  (POSIXTime
   -&gt; MarkWhen -&gt; TraceWhen -&gt; Verbosity -&gt; String -&gt; String)
POSIXTime -&gt; MarkWhen -&gt; TraceWhen -&gt; Verbosity -&gt; String -&gt; String
</span><a href="Distribution.Simple.Utils.html#withMetadata"><span class="hs-identifier hs-var">withMetadata</span></a></span><span> </span><span class="annot"><span class="annottext">POSIXTime
</span><a href="#local-6989586621679682478"><span class="hs-identifier hs-var">ts</span></a></span><span> </span><span class="annot"><span class="annottext">MarkWhen
</span><a href="Distribution.Simple.Utils.html#NeverMark"><span class="hs-identifier hs-var">NeverMark</span></a></span><span> </span><span class="annot"><span class="annottext">TraceWhen
</span><a href="Distribution.Simple.Utils.html#FlagTrace"><span class="hs-identifier hs-var">FlagTrace</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682488"><span class="hs-identifier hs-var">verbosity</span></a></span><span>
</span><span id="line-510"></span><span>        </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; String -&gt; String
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; String
</span><a href="Distribution.Simple.Utils.html#wrapTextVerbosity"><span class="hs-identifier hs-var">wrapTextVerbosity</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682488"><span class="hs-identifier hs-var">verbosity</span></a></span><span>
</span><span id="line-511"></span><span>        </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; String -&gt; String
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682487"><span class="hs-identifier hs-var">msg</span></a></span><span>
</span><span id="line-512"></span><span>
</span><span id="line-513"></span><span class="annot"><a href="Distribution.Simple.Utils.html#infoNoWrap"><span class="hs-identifier hs-type">infoNoWrap</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-514"></span><span id="infoNoWrap"><span class="annot"><span class="annottext">infoNoWrap :: Verbosity -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#infoNoWrap"><span class="hs-identifier hs-var hs-var">infoNoWrap</span></a></span></span><span> </span><span id="local-6989586621679682477"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682477"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679682476"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682476"><span class="hs-identifier hs-var">msg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HasCallStack =&gt; IO ()) -&gt; IO ()
forall a. HasCallStack =&gt; (HasCallStack =&gt; a) -&gt; a
</span><a href="../../base/src/GHC.Stack.html#withFrozenCallStack"><span class="hs-identifier hs-var">withFrozenCallStack</span></a></span><span> </span><span class="annot"><span class="annottext">((HasCallStack =&gt; IO ()) -&gt; IO ())
-&gt; (HasCallStack =&gt; IO ()) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-515"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682477"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; Verbosity -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="Distribution.Verbosity.html#verbose"><span class="hs-identifier hs-var">verbose</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-516"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679682469"><span class="annot"><span class="annottext">h :: Handle
</span><a href="#local-6989586621679682469"><span class="hs-identifier hs-var hs-var">h</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; Handle
</span><a href="Distribution.Simple.Utils.html#verbosityHandle"><span class="hs-identifier hs-var">verbosityHandle</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682477"><span class="hs-identifier hs-var">verbosity</span></a></span><span>
</span><span id="line-517"></span><span>    </span><span id="local-6989586621679682468"><span class="annot"><span class="annottext">POSIXTime
</span><a href="#local-6989586621679682468"><span class="hs-identifier hs-var">ts</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO POSIXTime
</span><a href="../../time/src/Data.Time.Clock.POSIX.html#getPOSIXTime"><span class="hs-identifier hs-var">getPOSIXTime</span></a></span><span>
</span><span id="line-518"></span><span>    </span><span class="annot"><span class="annottext">Handle -&gt; String -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.Text.html#hPutStr"><span class="hs-identifier hs-var">hPutStr</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679682469"><span class="hs-identifier hs-var">h</span></a></span><span>
</span><span id="line-519"></span><span>        </span><span class="annot"><span class="annottext">(String -&gt; IO ()) -&gt; String -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">WithCallStack
  (POSIXTime
   -&gt; MarkWhen -&gt; TraceWhen -&gt; Verbosity -&gt; String -&gt; String)
POSIXTime -&gt; MarkWhen -&gt; TraceWhen -&gt; Verbosity -&gt; String -&gt; String
</span><a href="Distribution.Simple.Utils.html#withMetadata"><span class="hs-identifier hs-var">withMetadata</span></a></span><span> </span><span class="annot"><span class="annottext">POSIXTime
</span><a href="#local-6989586621679682468"><span class="hs-identifier hs-var">ts</span></a></span><span> </span><span class="annot"><span class="annottext">MarkWhen
</span><a href="Distribution.Simple.Utils.html#NeverMark"><span class="hs-identifier hs-var">NeverMark</span></a></span><span> </span><span class="annot"><span class="annottext">TraceWhen
</span><a href="Distribution.Simple.Utils.html#FlagTrace"><span class="hs-identifier hs-var">FlagTrace</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682477"><span class="hs-identifier hs-var">verbosity</span></a></span><span>
</span><span id="line-520"></span><span>        </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; String -&gt; String
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682476"><span class="hs-identifier hs-var">msg</span></a></span><span>
</span><span id="line-521"></span><span>
</span><span id="line-522"></span><span class="hs-comment">-- | Detailed internal debugging information</span><span>
</span><span id="line-523"></span><span class="hs-comment">--</span><span>
</span><span id="line-524"></span><span class="hs-comment">-- We display these messages when the verbosity level is 'deafening'</span><span>
</span><span id="line-525"></span><span class="hs-comment">--</span><span>
</span><span id="line-526"></span><span class="annot"><a href="Distribution.Simple.Utils.html#debug"><span class="hs-identifier hs-type">debug</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-527"></span><span id="debug"><span class="annot"><span class="annottext">debug :: Verbosity -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#debug"><span class="hs-identifier hs-var hs-var">debug</span></a></span></span><span> </span><span id="local-6989586621679682467"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682467"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679682466"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682466"><span class="hs-identifier hs-var">msg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HasCallStack =&gt; IO ()) -&gt; IO ()
forall a. HasCallStack =&gt; (HasCallStack =&gt; a) -&gt; a
</span><a href="../../base/src/GHC.Stack.html#withFrozenCallStack"><span class="hs-identifier hs-var">withFrozenCallStack</span></a></span><span> </span><span class="annot"><span class="annottext">((HasCallStack =&gt; IO ()) -&gt; IO ())
-&gt; (HasCallStack =&gt; IO ()) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-528"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682467"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; Verbosity -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="Distribution.Verbosity.html#deafening"><span class="hs-identifier hs-var">deafening</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-529"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679682457"><span class="annot"><span class="annottext">h :: Handle
</span><a href="#local-6989586621679682457"><span class="hs-identifier hs-var hs-var">h</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; Handle
</span><a href="Distribution.Simple.Utils.html#verbosityHandle"><span class="hs-identifier hs-var">verbosityHandle</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682467"><span class="hs-identifier hs-var">verbosity</span></a></span><span>
</span><span id="line-530"></span><span>    </span><span id="local-6989586621679682456"><span class="annot"><span class="annottext">POSIXTime
</span><a href="#local-6989586621679682456"><span class="hs-identifier hs-var">ts</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO POSIXTime
</span><a href="../../time/src/Data.Time.Clock.POSIX.html#getPOSIXTime"><span class="hs-identifier hs-var">getPOSIXTime</span></a></span><span>
</span><span id="line-531"></span><span>    </span><span class="annot"><span class="annottext">Handle -&gt; String -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.Text.html#hPutStr"><span class="hs-identifier hs-var">hPutStr</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679682457"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; IO ()) -&gt; String -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">WithCallStack
  (POSIXTime
   -&gt; MarkWhen -&gt; TraceWhen -&gt; Verbosity -&gt; String -&gt; String)
POSIXTime -&gt; MarkWhen -&gt; TraceWhen -&gt; Verbosity -&gt; String -&gt; String
</span><a href="Distribution.Simple.Utils.html#withMetadata"><span class="hs-identifier hs-var">withMetadata</span></a></span><span> </span><span class="annot"><span class="annottext">POSIXTime
</span><a href="#local-6989586621679682456"><span class="hs-identifier hs-var">ts</span></a></span><span> </span><span class="annot"><span class="annottext">MarkWhen
</span><a href="Distribution.Simple.Utils.html#NeverMark"><span class="hs-identifier hs-var">NeverMark</span></a></span><span> </span><span class="annot"><span class="annottext">TraceWhen
</span><a href="Distribution.Simple.Utils.html#FlagTrace"><span class="hs-identifier hs-var">FlagTrace</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682467"><span class="hs-identifier hs-var">verbosity</span></a></span><span>
</span><span id="line-532"></span><span>              </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; String -&gt; String
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; String
</span><a href="Distribution.Simple.Utils.html#wrapTextVerbosity"><span class="hs-identifier hs-var">wrapTextVerbosity</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682467"><span class="hs-identifier hs-var">verbosity</span></a></span><span>
</span><span id="line-533"></span><span>              </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; String -&gt; String
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682466"><span class="hs-identifier hs-var">msg</span></a></span><span>
</span><span id="line-534"></span><span>    </span><span class="hs-comment">-- ensure that we don't lose output if we segfault/infinite loop</span><span>
</span><span id="line-535"></span><span>    </span><span class="annot"><span class="annottext">Handle -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.html#hFlush"><span class="hs-identifier hs-var">hFlush</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="../../base/src/GHC.IO.StdHandles.html#stdout"><span class="hs-identifier hs-var">stdout</span></a></span><span>
</span><span id="line-536"></span><span>
</span><span id="line-537"></span><span class="hs-comment">-- | A variant of 'debug' that doesn't perform the automatic line</span><span>
</span><span id="line-538"></span><span class="hs-comment">-- wrapping. Produces better output in some cases.</span><span>
</span><span id="line-539"></span><span class="annot"><a href="Distribution.Simple.Utils.html#debugNoWrap"><span class="hs-identifier hs-type">debugNoWrap</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-540"></span><span id="debugNoWrap"><span class="annot"><span class="annottext">debugNoWrap :: Verbosity -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#debugNoWrap"><span class="hs-identifier hs-var hs-var">debugNoWrap</span></a></span></span><span> </span><span id="local-6989586621679682455"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682455"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679682454"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682454"><span class="hs-identifier hs-var">msg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HasCallStack =&gt; IO ()) -&gt; IO ()
forall a. HasCallStack =&gt; (HasCallStack =&gt; a) -&gt; a
</span><a href="../../base/src/GHC.Stack.html#withFrozenCallStack"><span class="hs-identifier hs-var">withFrozenCallStack</span></a></span><span> </span><span class="annot"><span class="annottext">((HasCallStack =&gt; IO ()) -&gt; IO ())
-&gt; (HasCallStack =&gt; IO ()) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-541"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682455"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; Verbosity -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="Distribution.Verbosity.html#deafening"><span class="hs-identifier hs-var">deafening</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-542"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679682446"><span class="annot"><span class="annottext">h :: Handle
</span><a href="#local-6989586621679682446"><span class="hs-identifier hs-var hs-var">h</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; Handle
</span><a href="Distribution.Simple.Utils.html#verbosityHandle"><span class="hs-identifier hs-var">verbosityHandle</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682455"><span class="hs-identifier hs-var">verbosity</span></a></span><span>
</span><span id="line-543"></span><span>    </span><span id="local-6989586621679682445"><span class="annot"><span class="annottext">POSIXTime
</span><a href="#local-6989586621679682445"><span class="hs-identifier hs-var">ts</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO POSIXTime
</span><a href="../../time/src/Data.Time.Clock.POSIX.html#getPOSIXTime"><span class="hs-identifier hs-var">getPOSIXTime</span></a></span><span>
</span><span id="line-544"></span><span>    </span><span class="annot"><span class="annottext">Handle -&gt; String -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.Text.html#hPutStr"><span class="hs-identifier hs-var">hPutStr</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679682446"><span class="hs-identifier hs-var">h</span></a></span><span>
</span><span id="line-545"></span><span>        </span><span class="annot"><span class="annottext">(String -&gt; IO ()) -&gt; String -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">WithCallStack
  (POSIXTime
   -&gt; MarkWhen -&gt; TraceWhen -&gt; Verbosity -&gt; String -&gt; String)
POSIXTime -&gt; MarkWhen -&gt; TraceWhen -&gt; Verbosity -&gt; String -&gt; String
</span><a href="Distribution.Simple.Utils.html#withMetadata"><span class="hs-identifier hs-var">withMetadata</span></a></span><span> </span><span class="annot"><span class="annottext">POSIXTime
</span><a href="#local-6989586621679682445"><span class="hs-identifier hs-var">ts</span></a></span><span> </span><span class="annot"><span class="annottext">MarkWhen
</span><a href="Distribution.Simple.Utils.html#NeverMark"><span class="hs-identifier hs-var">NeverMark</span></a></span><span> </span><span class="annot"><span class="annottext">TraceWhen
</span><a href="Distribution.Simple.Utils.html#FlagTrace"><span class="hs-identifier hs-var">FlagTrace</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682455"><span class="hs-identifier hs-var">verbosity</span></a></span><span>
</span><span id="line-546"></span><span>        </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; String -&gt; String
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682454"><span class="hs-identifier hs-var">msg</span></a></span><span>
</span><span id="line-547"></span><span>    </span><span class="hs-comment">-- ensure that we don't lose output if we segfault/infinite loop</span><span>
</span><span id="line-548"></span><span>    </span><span class="annot"><span class="annottext">Handle -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.html#hFlush"><span class="hs-identifier hs-var">hFlush</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="../../base/src/GHC.IO.StdHandles.html#stdout"><span class="hs-identifier hs-var">stdout</span></a></span><span>
</span><span id="line-549"></span><span>
</span><span id="line-550"></span><span class="hs-comment">-- | Perform an IO action, catching any IO exceptions and printing an error</span><span>
</span><span id="line-551"></span><span class="hs-comment">--   if one occurs.</span><span>
</span><span id="line-552"></span><span class="annot"><a href="Distribution.Simple.Utils.html#chattyTry"><span class="hs-identifier hs-type">chattyTry</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>  </span><span class="hs-comment">-- ^ a description of the action we were attempting</span><span>
</span><span id="line-553"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>   </span><span class="hs-comment">-- ^ the action itself</span><span>
</span><span id="line-554"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-555"></span><span id="chattyTry"><span class="annot"><span class="annottext">chattyTry :: String -&gt; IO () -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#chattyTry"><span class="hs-identifier hs-var hs-var">chattyTry</span></a></span></span><span> </span><span id="local-6989586621679682444"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682444"><span class="hs-identifier hs-var">desc</span></a></span></span><span> </span><span id="local-6989586621679682443"><span class="annot"><span class="annottext">IO ()
</span><a href="#local-6989586621679682443"><span class="hs-identifier hs-var">action</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-556"></span><span>  </span><span class="annot"><span class="annottext">IO () -&gt; (IOException -&gt; IO ()) -&gt; IO ()
forall a. IO a -&gt; (IOException -&gt; IO a) -&gt; IO a
</span><a href="Distribution.Compat.Exception.html#catchIO"><span class="hs-identifier hs-var">catchIO</span></a></span><span> </span><span class="annot"><span class="annottext">IO ()
</span><a href="#local-6989586621679682443"><span class="hs-identifier hs-var">action</span></a></span><span> </span><span class="annot"><span class="annottext">((IOException -&gt; IO ()) -&gt; IO ())
-&gt; (IOException -&gt; IO ()) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679682441"><span class="annot"><span class="annottext">IOException
</span><a href="#local-6989586621679682441"><span class="hs-identifier hs-var">exception</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-557"></span><span>    </span><span class="annot"><span class="annottext">Handle -&gt; String -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.Text.html#hPutStrLn"><span class="hs-identifier hs-var">hPutStrLn</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="../../base/src/GHC.IO.StdHandles.html#stderr"><span class="hs-identifier hs-var">stderr</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; IO ()) -&gt; String -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Error while &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682444"><span class="hs-identifier hs-var">desc</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;: &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">IOException -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">IOException
</span><a href="#local-6989586621679682441"><span class="hs-identifier hs-var">exception</span></a></span><span>
</span><span id="line-558"></span><span>
</span><span id="line-559"></span><span class="hs-comment">-- | Run an IO computation, returning @e@ if it raises a &quot;file</span><span>
</span><span id="line-560"></span><span class="hs-comment">-- does not exist&quot; error.</span><span>
</span><span id="line-561"></span><span id="local-6989586621679683151"><span class="annot"><a href="Distribution.Simple.Utils.html#handleDoesNotExist"><span class="hs-identifier hs-type">handleDoesNotExist</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679683151"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621679683151"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621679683151"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-562"></span><span id="handleDoesNotExist"><span class="annot"><span class="annottext">handleDoesNotExist :: forall a. a -&gt; IO a -&gt; IO a
</span><a href="Distribution.Simple.Utils.html#handleDoesNotExist"><span class="hs-identifier hs-var hs-var">handleDoesNotExist</span></a></span></span><span> </span><span id="local-6989586621679682438"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679682438"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-563"></span><span>    </span><span class="annot"><span class="annottext">(IOException -&gt; Maybe IOException)
-&gt; (IOException -&gt; IO a) -&gt; IO a -&gt; IO a
forall e b a.
Exception e =&gt;
(e -&gt; Maybe b) -&gt; (b -&gt; IO a) -&gt; IO a -&gt; IO a
</span><a href="../../base/src/Control.Exception.Base.html#handleJust"><span class="hs-identifier hs-var">Exception.handleJust</span></a></span><span>
</span><span id="line-564"></span><span>      </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679682436"><span class="annot"><span class="annottext">IOException
</span><a href="#local-6989586621679682436"><span class="hs-identifier hs-var">ioe</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">IOException -&gt; Bool
</span><a href="../../base/src/System.IO.Error.html#isDoesNotExistError"><span class="hs-identifier hs-var">isDoesNotExistError</span></a></span><span> </span><span class="annot"><span class="annottext">IOException
</span><a href="#local-6989586621679682436"><span class="hs-identifier hs-var">ioe</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">IOException -&gt; Maybe IOException
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">IOException
</span><a href="#local-6989586621679682436"><span class="hs-identifier hs-var">ioe</span></a></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Maybe IOException
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-565"></span><span>      </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">IOException
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">a -&gt; IO a
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679682438"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-566"></span><span>
</span><span id="line-567"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-568"></span><span class="hs-comment">-- Helper functions</span><span>
</span><span id="line-569"></span><span>
</span><span id="line-570"></span><span class="hs-comment">-- | Wraps text unless the @+nowrap@ verbosity flag is active</span><span>
</span><span id="line-571"></span><span class="annot"><a href="Distribution.Simple.Utils.html#wrapTextVerbosity"><span class="hs-identifier hs-type">wrapTextVerbosity</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-572"></span><span id="wrapTextVerbosity"><span class="annot"><span class="annottext">wrapTextVerbosity :: Verbosity -&gt; String -&gt; String
</span><a href="Distribution.Simple.Utils.html#wrapTextVerbosity"><span class="hs-identifier hs-var hs-var">wrapTextVerbosity</span></a></span></span><span> </span><span id="local-6989586621679682434"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682434"><span class="hs-identifier hs-var">verb</span></a></span></span><span>
</span><span id="line-573"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; Bool
</span><a href="Distribution.Verbosity.html#isVerboseNoWrap"><span class="hs-identifier hs-var">isVerboseNoWrap</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682434"><span class="hs-identifier hs-var">verb</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="Distribution.Simple.Utils.html#withTrailingNewline"><span class="hs-identifier hs-var">withTrailingNewline</span></a></span><span>
</span><span id="line-574"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="Distribution.Simple.Utils.html#withTrailingNewline"><span class="hs-identifier hs-var">withTrailingNewline</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; (String -&gt; String) -&gt; String -&gt; String
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="Distribution.Utils.Generic.html#wrapText"><span class="hs-identifier hs-var">wrapText</span></a></span><span>
</span><span id="line-575"></span><span>
</span><span id="line-576"></span><span>
</span><span id="line-577"></span><span class="hs-comment">-- | Prepends a timestamp if @+timestamp@ verbosity flag is set</span><span>
</span><span id="line-578"></span><span class="hs-comment">--</span><span>
</span><span id="line-579"></span><span class="hs-comment">-- This is used by 'withMetadata'</span><span>
</span><span id="line-580"></span><span class="hs-comment">--</span><span>
</span><span id="line-581"></span><span class="annot"><a href="Distribution.Simple.Utils.html#withTimestamp"><span class="hs-identifier hs-type">withTimestamp</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../time/src/Data.Time.Clock.Internal.POSIXTime.html#POSIXTime"><span class="hs-identifier hs-type">POSIXTime</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-582"></span><span id="withTimestamp"><span class="annot"><span class="annottext">withTimestamp :: Verbosity -&gt; POSIXTime -&gt; String -&gt; String
</span><a href="Distribution.Simple.Utils.html#withTimestamp"><span class="hs-identifier hs-var hs-var">withTimestamp</span></a></span></span><span> </span><span id="local-6989586621679682430"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682430"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span id="local-6989586621679682429"><span class="annot"><span class="annottext">POSIXTime
</span><a href="#local-6989586621679682429"><span class="hs-identifier hs-var">ts</span></a></span></span><span> </span><span id="local-6989586621679682428"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682428"><span class="hs-identifier hs-var">msg</span></a></span></span><span>
</span><span id="line-583"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; Bool
</span><a href="Distribution.Verbosity.html#isVerboseTimestamp"><span class="hs-identifier hs-var">isVerboseTimestamp</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682430"><span class="hs-identifier hs-var">v</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682426"><span class="hs-identifier hs-var">msg'</span></a></span><span>
</span><span id="line-584"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682428"><span class="hs-identifier hs-var">msg</span></a></span><span> </span><span class="hs-comment">-- no-op</span><span>
</span><span id="line-585"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-586"></span><span>    </span><span id="local-6989586621679682426"><span class="annot"><span class="annottext">msg' :: String
</span><a href="#local-6989586621679682426"><span class="hs-identifier hs-var hs-var">msg'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">String -&gt; [String]
</span><a href="../../base/src/Data.OldList.html#lines"><span class="hs-identifier hs-var">lines</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682428"><span class="hs-identifier hs-var">msg</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-587"></span><span>      </span><span class="hs-special">[</span><span class="hs-special">]</span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="#local-6989586621679682424"><span class="hs-identifier hs-var">tsstr</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;\n&quot;</span></span><span>
</span><span id="line-588"></span><span>      </span><span id="local-6989586621679682423"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682423"><span class="hs-identifier hs-var">l1</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679682422"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682422"><span class="hs-identifier hs-var">rest</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; String
</span><a href="../../base/src/Data.OldList.html#unlines"><span class="hs-identifier hs-var">unlines</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="#local-6989586621679682424"><span class="hs-identifier hs-var">tsstr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">' '</span></span><span class="annot"><span class="annottext">Char -&gt; String -&gt; String
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682423"><span class="hs-identifier hs-var">l1</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String -&gt; [String] -&gt; [String]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; [String] -&gt; [String]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682420"><span class="hs-identifier hs-var">contpfx</span></a></span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682422"><span class="hs-identifier hs-var">rest</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-589"></span><span>
</span><span id="line-590"></span><span>    </span><span class="hs-comment">-- format timestamp to be prepended to first line with msec precision</span><span>
</span><span id="line-591"></span><span>    </span><span id="local-6989586621679682424"><span class="annot"><span class="annottext">tsstr :: String -&gt; String
</span><a href="#local-6989586621679682424"><span class="hs-identifier hs-var hs-var">tsstr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe Int -&gt; Double -&gt; String -&gt; String
forall a. RealFloat a =&gt; Maybe Int -&gt; a -&gt; String -&gt; String
</span><a href="../../base/src/Numeric.html#showFFloat"><span class="hs-identifier hs-var">showFFloat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Maybe Int
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">3</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">POSIXTime -&gt; Double
forall a b. (Real a, Fractional b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#realToFrac"><span class="hs-identifier hs-var">realToFrac</span></a></span><span> </span><span class="annot"><span class="annottext">POSIXTime
</span><a href="#local-6989586621679682429"><span class="hs-identifier hs-var">ts</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Double</span></span><span class="hs-special">)</span><span>
</span><span id="line-592"></span><span>
</span><span id="line-593"></span><span>    </span><span class="hs-comment">-- continuation prefix for subsequent lines of msg</span><span>
</span><span id="line-594"></span><span>    </span><span id="local-6989586621679682420"><span class="annot"><span class="annottext">contpfx :: String
</span><a href="#local-6989586621679682420"><span class="hs-identifier hs-var hs-var">contpfx</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Char -&gt; String
forall a. Int -&gt; a -&gt; [a]
</span><a href="../../base/src/GHC.List.html#replicate"><span class="hs-identifier hs-var">replicate</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="#local-6989586621679682424"><span class="hs-identifier hs-var">tsstr</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; &quot;</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">' '</span></span><span>
</span><span id="line-595"></span><span>
</span><span id="line-596"></span><span class="hs-comment">-- | Wrap output with a marker if @+markoutput@ verbosity flag is set.</span><span>
</span><span id="line-597"></span><span class="hs-comment">--</span><span>
</span><span id="line-598"></span><span class="hs-comment">-- NB: Why is markoutput done with start/end markers, and not prefixes?</span><span>
</span><span id="line-599"></span><span class="hs-comment">-- Markers are more convenient to add (if we want to add prefixes,</span><span>
</span><span id="line-600"></span><span class="hs-comment">-- we have to 'lines' and then 'map'; here's it's just some</span><span>
</span><span id="line-601"></span><span class="hs-comment">-- concatenates).  Note that even in the prefix case, we can't</span><span>
</span><span id="line-602"></span><span class="hs-comment">-- guarantee that the markers are unambiguous, because some of</span><span>
</span><span id="line-603"></span><span class="hs-comment">-- Cabal's output comes straight from external programs, where</span><span>
</span><span id="line-604"></span><span class="hs-comment">-- we don't have the ability to interpose on the output.</span><span>
</span><span id="line-605"></span><span class="hs-comment">--</span><span>
</span><span id="line-606"></span><span class="hs-comment">-- This is used by 'withMetadata'</span><span>
</span><span id="line-607"></span><span class="hs-comment">--</span><span>
</span><span id="line-608"></span><span class="annot"><a href="Distribution.Simple.Utils.html#withOutputMarker"><span class="hs-identifier hs-type">withOutputMarker</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-609"></span><span id="withOutputMarker"><span class="annot"><span class="annottext">withOutputMarker :: Verbosity -&gt; String -&gt; String
</span><a href="Distribution.Simple.Utils.html#withOutputMarker"><span class="hs-identifier hs-var hs-var">withOutputMarker</span></a></span></span><span> </span><span id="local-6989586621679682417"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682417"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span id="local-6989586621679682416"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682416"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Verbosity -&gt; Bool
</span><a href="Distribution.Verbosity.html#isVerboseMarkOutput"><span class="hs-identifier hs-var">isVerboseMarkOutput</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682417"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682416"><span class="hs-identifier hs-var">xs</span></a></span><span>
</span><span id="line-610"></span><span class="annot"><a href="Distribution.Simple.Utils.html#withOutputMarker"><span class="hs-identifier hs-var">withOutputMarker</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span> </span><span class="hs-comment">-- Minor optimization, don't mark uselessly</span><span>
</span><span id="line-611"></span><span class="annot"><a href="Distribution.Simple.Utils.html#withOutputMarker"><span class="hs-identifier hs-var">withOutputMarker</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679682413"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682413"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-612"></span><span>    </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;-----BEGIN CABAL OUTPUT-----\n&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span>
</span><span id="line-613"></span><span>    </span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="Distribution.Simple.Utils.html#withTrailingNewline"><span class="hs-identifier hs-var">withTrailingNewline</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682413"><span class="hs-identifier hs-var">xs</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span>
</span><span id="line-614"></span><span>    </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;-----END CABAL OUTPUT-----\n&quot;</span></span><span>
</span><span id="line-615"></span><span>
</span><span id="line-616"></span><span class="hs-comment">-- | Append a trailing newline to a string if it does not</span><span>
</span><span id="line-617"></span><span class="hs-comment">-- already have a trailing newline.</span><span>
</span><span id="line-618"></span><span class="hs-comment">--</span><span>
</span><span id="line-619"></span><span class="annot"><a href="Distribution.Simple.Utils.html#withTrailingNewline"><span class="hs-identifier hs-type">withTrailingNewline</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-620"></span><span id="withTrailingNewline"><span class="annot"><span class="annottext">withTrailingNewline :: String -&gt; String
</span><a href="Distribution.Simple.Utils.html#withTrailingNewline"><span class="hs-identifier hs-var hs-var">withTrailingNewline</span></a></span></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-621"></span><span class="annot"><a href="Distribution.Simple.Utils.html#withTrailingNewline"><span class="hs-identifier hs-var">withTrailingNewline</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679682412"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679682412"><span class="hs-identifier hs-var">x</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679682411"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682411"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679682412"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; String -&gt; String
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">Char -&gt; String -&gt; String
</span><a href="#local-6989586621679682410"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679682412"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682411"><span class="hs-identifier hs-var">xs</span></a></span><span>
</span><span id="line-622"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-623"></span><span>    </span><span id="local-6989586621679682410"><span class="annot"><span class="annottext">go :: Char -&gt; String -&gt; String
</span><a href="#local-6989586621679682410"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span>   </span><span class="annot"><span class="annottext">Char
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679682409"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679682409"><span class="hs-identifier hs-var">c</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679682408"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682408"><span class="hs-identifier hs-var">cs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679682409"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; String -&gt; String
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">Char -&gt; String -&gt; String
</span><a href="#local-6989586621679682410"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679682409"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682408"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-624"></span><span>    </span><span class="annot"><a href="#local-6989586621679682410"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\n'</span></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-625"></span><span>    </span><span class="annot"><a href="#local-6989586621679682410"><span class="hs-identifier hs-var">go</span></a></span><span>   </span><span class="annot"><span class="annottext">Char
</span><span class="hs-identifier">_</span></span><span>  </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;\n&quot;</span></span><span>
</span><span id="line-626"></span><span>
</span><span id="line-627"></span><span class="hs-comment">-- | Prepend a call-site and/or call-stack based on Verbosity</span><span>
</span><span id="line-628"></span><span class="hs-comment">--</span><span>
</span><span id="line-629"></span><span class="annot"><a href="Distribution.Simple.Utils.html#withCallStackPrefix"><span class="hs-identifier hs-type">withCallStackPrefix</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Compat.Stack.html#WithCallStack"><span class="hs-identifier hs-type">WithCallStack</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Utils.html#TraceWhen"><span class="hs-identifier hs-type">TraceWhen</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-630"></span><span id="withCallStackPrefix"><span class="annot"><span class="annottext">withCallStackPrefix :: WithCallStack (TraceWhen -&gt; Verbosity -&gt; String -&gt; String)
</span><a href="Distribution.Simple.Utils.html#withCallStackPrefix"><span class="hs-identifier hs-var hs-var">withCallStackPrefix</span></a></span></span><span> </span><span id="local-6989586621679682403"><span class="annot"><span class="annottext">TraceWhen
</span><a href="#local-6989586621679682403"><span class="hs-identifier hs-var">tracer</span></a></span></span><span> </span><span id="local-6989586621679682402"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682402"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679682401"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682401"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HasCallStack =&gt; String) -&gt; String
forall a. HasCallStack =&gt; (HasCallStack =&gt; a) -&gt; a
</span><a href="../../base/src/GHC.Stack.html#withFrozenCallStack"><span class="hs-identifier hs-var">withFrozenCallStack</span></a></span><span> </span><span class="annot"><span class="annottext">((HasCallStack =&gt; String) -&gt; String)
-&gt; (HasCallStack =&gt; String) -&gt; String
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-631"></span><span>    </span><span class="hs-special">(</span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; Bool
</span><a href="Distribution.Verbosity.html#isVerboseCallSite"><span class="hs-identifier hs-var">isVerboseCallSite</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682402"><span class="hs-identifier hs-var">verbosity</span></a></span><span>
</span><span id="line-632"></span><span>        </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">String
HasCallStack =&gt; String
</span><a href="Distribution.Compat.Stack.html#parentSrcLocPrefix"><span class="hs-identifier hs-var">parentSrcLocPrefix</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span>
</span><span id="line-633"></span><span>             </span><span class="hs-comment">-- Hack: need a newline before starting output marker :(</span><span>
</span><span id="line-634"></span><span>             </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; Bool
</span><a href="Distribution.Verbosity.html#isVerboseMarkOutput"><span class="hs-identifier hs-var">isVerboseMarkOutput</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682402"><span class="hs-identifier hs-var">verbosity</span></a></span><span>
</span><span id="line-635"></span><span>                </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;\n&quot;</span></span><span>
</span><span id="line-636"></span><span>                </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-637"></span><span>        </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span>
</span><span id="line-638"></span><span>    </span><span class="hs-special">(</span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; TraceWhen -&gt; Maybe String
</span><a href="Distribution.Simple.Utils.html#traceWhen"><span class="hs-identifier hs-var">traceWhen</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682402"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">TraceWhen
</span><a href="#local-6989586621679682403"><span class="hs-identifier hs-var">tracer</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-639"></span><span>        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679682392"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682392"><span class="hs-identifier hs-var">pre</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682392"><span class="hs-identifier hs-var">pre</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">CallStack -&gt; String
</span><a href="../../base/src/GHC.Exception.html#prettyCallStack"><span class="hs-identifier hs-var">prettyCallStack</span></a></span><span> </span><span class="annot"><span class="annottext">CallStack
HasCallStack =&gt; CallStack
</span><a href="../../base/src/GHC.Stack.html#callStack"><span class="hs-identifier hs-var">callStack</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;\n&quot;</span></span><span>
</span><span id="line-640"></span><span>        </span><span class="annot"><span class="annottext">Maybe String
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span>
</span><span id="line-641"></span><span>    </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682401"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-642"></span><span>
</span><span id="line-643"></span><span class="hs-comment">-- | When should we emit the call stack?  We always emit</span><span>
</span><span id="line-644"></span><span class="hs-comment">-- for internal errors, emit the trace for errors when we</span><span>
</span><span id="line-645"></span><span class="hs-comment">-- are in verbose mode, and otherwise only emit it if</span><span>
</span><span id="line-646"></span><span class="hs-comment">-- explicitly asked for using the @+callstack@ verbosity</span><span>
</span><span id="line-647"></span><span class="hs-comment">-- flag.  (At the moment, 'AlwaysTrace' is not used.</span><span>
</span><span id="line-648"></span><span class="hs-comment">--</span><span>
</span><span id="line-649"></span><span class="hs-keyword">data</span><span> </span><span id="TraceWhen"><span class="annot"><a href="Distribution.Simple.Utils.html#TraceWhen"><span class="hs-identifier hs-var">TraceWhen</span></a></span></span><span>
</span><span id="line-650"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span id="AlwaysTrace"><span class="annot"><a href="Distribution.Simple.Utils.html#AlwaysTrace"><span class="hs-identifier hs-var">AlwaysTrace</span></a></span></span><span>
</span><span id="line-651"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span id="VerboseTrace"><span class="annot"><a href="Distribution.Simple.Utils.html#VerboseTrace"><span class="hs-identifier hs-var">VerboseTrace</span></a></span></span><span>
</span><span id="line-652"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span id="FlagTrace"><span class="annot"><a href="Distribution.Simple.Utils.html#FlagTrace"><span class="hs-identifier hs-var">FlagTrace</span></a></span></span><span>
</span><span id="line-653"></span><span>    </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679682386"><span id="local-6989586621679682388"><span class="annot"><span class="annottext">TraceWhen -&gt; TraceWhen -&gt; Bool
(TraceWhen -&gt; TraceWhen -&gt; Bool)
-&gt; (TraceWhen -&gt; TraceWhen -&gt; Bool) -&gt; Eq TraceWhen
forall a. (a -&gt; a -&gt; Bool) -&gt; (a -&gt; a -&gt; Bool) -&gt; Eq a
/= :: TraceWhen -&gt; TraceWhen -&gt; Bool
$c/= :: TraceWhen -&gt; TraceWhen -&gt; Bool
== :: TraceWhen -&gt; TraceWhen -&gt; Bool
$c== :: TraceWhen -&gt; TraceWhen -&gt; Bool
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Eq</span></span></span></span><span class="hs-special">)</span><span>
</span><span id="line-654"></span><span>
</span><span id="line-655"></span><span class="hs-comment">-- | Determine if we should emit a call stack.</span><span>
</span><span id="line-656"></span><span class="hs-comment">-- If we trace, it also emits any prefix we should append.</span><span>
</span><span id="line-657"></span><span class="annot"><a href="Distribution.Simple.Utils.html#traceWhen"><span class="hs-identifier hs-type">traceWhen</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Utils.html#TraceWhen"><span class="hs-identifier hs-type">TraceWhen</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-658"></span><span id="traceWhen"><span class="annot"><span class="annottext">traceWhen :: Verbosity -&gt; TraceWhen -&gt; Maybe String
</span><a href="Distribution.Simple.Utils.html#traceWhen"><span class="hs-identifier hs-var hs-var">traceWhen</span></a></span></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">TraceWhen
</span><a href="Distribution.Simple.Utils.html#AlwaysTrace"><span class="hs-identifier hs-var">AlwaysTrace</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Maybe String
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-659"></span><span class="annot"><a href="Distribution.Simple.Utils.html#traceWhen"><span class="hs-identifier hs-var">traceWhen</span></a></span><span> </span><span id="local-6989586621679682384"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682384"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span class="annot"><span class="annottext">TraceWhen
</span><a href="Distribution.Simple.Utils.html#VerboseTrace"><span class="hs-identifier hs-var">VerboseTrace</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682384"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; Verbosity -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="Distribution.Verbosity.html#verbose"><span class="hs-identifier hs-var">verbose</span></a></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Maybe String
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-660"></span><span class="annot"><a href="Distribution.Simple.Utils.html#traceWhen"><span class="hs-identifier hs-var">traceWhen</span></a></span><span> </span><span id="local-6989586621679682383"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682383"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span class="annot"><span class="annottext">TraceWhen
</span><a href="Distribution.Simple.Utils.html#FlagTrace"><span class="hs-identifier hs-var">FlagTrace</span></a></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; Bool
</span><a href="Distribution.Verbosity.html#isVerboseCallStack"><span class="hs-identifier hs-var">isVerboseCallStack</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682383"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Maybe String
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;----\n&quot;</span></span><span>
</span><span id="line-661"></span><span class="annot"><a href="Distribution.Simple.Utils.html#traceWhen"><span class="hs-identifier hs-var">traceWhen</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">TraceWhen
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe String
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-662"></span><span>
</span><span id="line-663"></span><span class="hs-comment">-- | When should we output the marker?  Things like 'die'</span><span>
</span><span id="line-664"></span><span class="hs-comment">-- always get marked, but a 'NormalMark' will only be</span><span>
</span><span id="line-665"></span><span class="hs-comment">-- output if we're not a quiet verbosity.</span><span>
</span><span id="line-666"></span><span class="hs-comment">--</span><span>
</span><span id="line-667"></span><span class="hs-keyword">data</span><span> </span><span id="MarkWhen"><span class="annot"><a href="Distribution.Simple.Utils.html#MarkWhen"><span class="hs-identifier hs-var">MarkWhen</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="AlwaysMark"><span class="annot"><a href="Distribution.Simple.Utils.html#AlwaysMark"><span class="hs-identifier hs-var">AlwaysMark</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="NormalMark"><span class="annot"><a href="Distribution.Simple.Utils.html#NormalMark"><span class="hs-identifier hs-var">NormalMark</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="NeverMark"><span class="annot"><a href="Distribution.Simple.Utils.html#NeverMark"><span class="hs-identifier hs-var">NeverMark</span></a></span></span><span>
</span><span id="line-668"></span><span>
</span><span id="line-669"></span><span class="hs-comment">-- | Add all necessary metadata to a logging message</span><span>
</span><span id="line-670"></span><span class="hs-comment">--</span><span>
</span><span id="line-671"></span><span class="annot"><a href="Distribution.Simple.Utils.html#withMetadata"><span class="hs-identifier hs-type">withMetadata</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Compat.Stack.html#WithCallStack"><span class="hs-identifier hs-type">WithCallStack</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../time/src/Data.Time.Clock.Internal.POSIXTime.html#POSIXTime"><span class="hs-identifier hs-type">POSIXTime</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Utils.html#MarkWhen"><span class="hs-identifier hs-type">MarkWhen</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Utils.html#TraceWhen"><span class="hs-identifier hs-type">TraceWhen</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-672"></span><span id="withMetadata"><span class="annot"><span class="annottext">withMetadata :: WithCallStack
  (POSIXTime
   -&gt; MarkWhen -&gt; TraceWhen -&gt; Verbosity -&gt; String -&gt; String)
</span><a href="Distribution.Simple.Utils.html#withMetadata"><span class="hs-identifier hs-var hs-var">withMetadata</span></a></span></span><span> </span><span id="local-6989586621679682378"><span class="annot"><span class="annottext">POSIXTime
</span><a href="#local-6989586621679682378"><span class="hs-identifier hs-var">ts</span></a></span></span><span> </span><span id="local-6989586621679682377"><span class="annot"><span class="annottext">MarkWhen
</span><a href="#local-6989586621679682377"><span class="hs-identifier hs-var">marker</span></a></span></span><span> </span><span id="local-6989586621679682376"><span class="annot"><span class="annottext">TraceWhen
</span><a href="#local-6989586621679682376"><span class="hs-identifier hs-var">tracer</span></a></span></span><span> </span><span id="local-6989586621679682375"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682375"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679682374"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682374"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HasCallStack =&gt; String) -&gt; String
forall a. HasCallStack =&gt; (HasCallStack =&gt; a) -&gt; a
</span><a href="../../base/src/GHC.Stack.html#withFrozenCallStack"><span class="hs-identifier hs-var">withFrozenCallStack</span></a></span><span> </span><span class="annot"><span class="annottext">((HasCallStack =&gt; String) -&gt; String)
-&gt; (HasCallStack =&gt; String) -&gt; String
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-673"></span><span>    </span><span class="hs-comment">-- NB: order matters.  Output marker first because we</span><span>
</span><span id="line-674"></span><span>    </span><span class="hs-comment">-- don't want to capture call stacks.</span><span>
</span><span id="line-675"></span><span>      </span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="Distribution.Simple.Utils.html#withTrailingNewline"><span class="hs-identifier hs-var">withTrailingNewline</span></a></span><span>
</span><span id="line-676"></span><span>    </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; (String -&gt; String) -&gt; String -&gt; String
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">WithCallStack (TraceWhen -&gt; Verbosity -&gt; String -&gt; String)
TraceWhen -&gt; Verbosity -&gt; String -&gt; String
</span><a href="Distribution.Simple.Utils.html#withCallStackPrefix"><span class="hs-identifier hs-var">withCallStackPrefix</span></a></span><span> </span><span class="annot"><span class="annottext">TraceWhen
</span><a href="#local-6989586621679682376"><span class="hs-identifier hs-var">tracer</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682375"><span class="hs-identifier hs-var">verbosity</span></a></span><span>
</span><span id="line-677"></span><span>    </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; (String -&gt; String) -&gt; String -&gt; String
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">MarkWhen
</span><a href="#local-6989586621679682377"><span class="hs-identifier hs-var">marker</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-678"></span><span>        </span><span class="annot"><span class="annottext">MarkWhen
</span><a href="Distribution.Simple.Utils.html#AlwaysMark"><span class="hs-identifier hs-var">AlwaysMark</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; String
</span><a href="Distribution.Simple.Utils.html#withOutputMarker"><span class="hs-identifier hs-var">withOutputMarker</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682375"><span class="hs-identifier hs-var">verbosity</span></a></span><span>
</span><span id="line-679"></span><span>        </span><span class="annot"><span class="annottext">MarkWhen
</span><a href="Distribution.Simple.Utils.html#NormalMark"><span class="hs-identifier hs-var">NormalMark</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Verbosity -&gt; Bool
</span><a href="Distribution.Verbosity.html#isVerboseQuiet"><span class="hs-identifier hs-var">isVerboseQuiet</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682375"><span class="hs-identifier hs-var">verbosity</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-680"></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; String
</span><a href="Distribution.Simple.Utils.html#withOutputMarker"><span class="hs-identifier hs-var">withOutputMarker</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682375"><span class="hs-identifier hs-var">verbosity</span></a></span><span>
</span><span id="line-681"></span><span>                   </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-682"></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; String
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-683"></span><span>        </span><span class="annot"><span class="annottext">MarkWhen
</span><a href="Distribution.Simple.Utils.html#NeverMark"><span class="hs-identifier hs-var">NeverMark</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; String
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-684"></span><span>    </span><span class="hs-comment">-- Clear out any existing markers</span><span>
</span><span id="line-685"></span><span>    </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; (String -&gt; String) -&gt; String -&gt; String
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="Distribution.Simple.Utils.html#clearMarkers"><span class="hs-identifier hs-var">clearMarkers</span></a></span><span>
</span><span id="line-686"></span><span>    </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; (String -&gt; String) -&gt; String -&gt; String
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; POSIXTime -&gt; String -&gt; String
</span><a href="Distribution.Simple.Utils.html#withTimestamp"><span class="hs-identifier hs-var">withTimestamp</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682375"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">POSIXTime
</span><a href="#local-6989586621679682378"><span class="hs-identifier hs-var">ts</span></a></span><span>
</span><span id="line-687"></span><span>    </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; String -&gt; String
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682374"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-688"></span><span>
</span><span id="line-689"></span><span class="annot"><a href="Distribution.Simple.Utils.html#clearMarkers"><span class="hs-identifier hs-type">clearMarkers</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-690"></span><span id="clearMarkers"><span class="annot"><span class="annottext">clearMarkers :: String -&gt; String
</span><a href="Distribution.Simple.Utils.html#clearMarkers"><span class="hs-identifier hs-var hs-var">clearMarkers</span></a></span></span><span> </span><span id="local-6989586621679682367"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682367"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; String
</span><a href="../../base/src/Data.OldList.html#unlines"><span class="hs-identifier hs-var">unlines</span></a></span><span> </span><span class="annot"><span class="annottext">([String] -&gt; String)
-&gt; ([String] -&gt; [String]) -&gt; [String] -&gt; String
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; Bool) -&gt; [String] -&gt; [String]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#filter"><span class="hs-identifier hs-var">filter</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; Bool
</span><a href="#local-6989586621679682366"><span class="hs-identifier hs-var">isMarker</span></a></span><span> </span><span class="annot"><span class="annottext">([String] -&gt; String) -&gt; [String] -&gt; String
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; [String]
</span><a href="../../base/src/Data.OldList.html#lines"><span class="hs-identifier hs-var">lines</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682367"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-691"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-692"></span><span>    </span><span id="local-6989586621679682366"><span class="annot"><span class="annottext">isMarker :: String -&gt; Bool
</span><a href="#local-6989586621679682366"><span class="hs-identifier hs-var hs-var">isMarker</span></a></span></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;-----BEGIN CABAL OUTPUT-----&quot;</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-693"></span><span>    </span><span class="annot"><a href="#local-6989586621679682366"><span class="hs-identifier hs-var">isMarker</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;-----END CABAL OUTPUT-----&quot;</span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-694"></span><span>    </span><span class="annot"><a href="#local-6989586621679682366"><span class="hs-identifier hs-var">isMarker</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-695"></span><span>
</span><span id="line-696"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-697"></span><span class="hs-comment">-- rawSystem variants</span><span>
</span><span id="line-698"></span><span class="annot"><a href="Distribution.Simple.Utils.html#maybeExit"><span class="hs-identifier hs-type">maybeExit</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Exception.html#ExitCode"><span class="hs-identifier hs-type">ExitCode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-699"></span><span id="maybeExit"><span class="annot"><span class="annottext">maybeExit :: IO ExitCode -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#maybeExit"><span class="hs-identifier hs-var hs-var">maybeExit</span></a></span></span><span> </span><span id="local-6989586621679682365"><span class="annot"><span class="annottext">IO ExitCode
</span><a href="#local-6989586621679682365"><span class="hs-identifier hs-var">cmd</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-700"></span><span>  </span><span id="local-6989586621679682364"><span class="annot"><span class="annottext">ExitCode
</span><a href="#local-6989586621679682364"><span class="hs-identifier hs-var">res</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO ExitCode
</span><a href="#local-6989586621679682365"><span class="hs-identifier hs-var">cmd</span></a></span><span>
</span><span id="line-701"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#unless"><span class="hs-identifier hs-var">unless</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ExitCode
</span><a href="#local-6989586621679682364"><span class="hs-identifier hs-var">res</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCode -&gt; ExitCode -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">ExitCode
</span><a href="../../base/src/GHC.IO.Exception.html#ExitSuccess"><span class="hs-identifier hs-var">ExitSuccess</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCode -&gt; IO ()
forall a. ExitCode -&gt; IO a
</span><a href="../../base/src/System.Exit.html#exitWith"><span class="hs-identifier hs-var">exitWith</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCode
</span><a href="#local-6989586621679682364"><span class="hs-identifier hs-var">res</span></a></span><span>
</span><span id="line-702"></span><span>
</span><span id="line-703"></span><span>
</span><span id="line-704"></span><span>
</span><span id="line-705"></span><span class="annot"><a href="Distribution.Simple.Utils.html#printRawCommandAndArgs"><span class="hs-identifier hs-type">printRawCommandAndArgs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-706"></span><span id="printRawCommandAndArgs"><span class="annot"><span class="annottext">printRawCommandAndArgs :: Verbosity -&gt; String -&gt; [String] -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#printRawCommandAndArgs"><span class="hs-identifier hs-var hs-var">printRawCommandAndArgs</span></a></span></span><span> </span><span id="local-6989586621679682361"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682361"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679682360"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682360"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span id="local-6989586621679682359"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682359"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HasCallStack =&gt; IO ()) -&gt; IO ()
forall a. HasCallStack =&gt; (HasCallStack =&gt; a) -&gt; a
</span><a href="../../base/src/GHC.Stack.html#withFrozenCallStack"><span class="hs-identifier hs-var">withFrozenCallStack</span></a></span><span> </span><span class="annot"><span class="annottext">((HasCallStack =&gt; IO ()) -&gt; IO ())
-&gt; (HasCallStack =&gt; IO ()) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-707"></span><span>    </span><span class="annot"><span class="annottext">Verbosity
-&gt; String
-&gt; [String]
-&gt; Maybe String
-&gt; Maybe [(String, String)]
-&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#printRawCommandAndArgsAndEnv"><span class="hs-identifier hs-var">printRawCommandAndArgsAndEnv</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682361"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682360"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682359"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe String
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe [(String, String)]
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-708"></span><span>
</span><span id="line-709"></span><span class="annot"><a href="Distribution.Simple.Utils.html#printRawCommandAndArgsAndEnv"><span class="hs-identifier hs-type">printRawCommandAndArgsAndEnv</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span>
</span><span id="line-710"></span><span>                             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-711"></span><span>                             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-712"></span><span>                             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-713"></span><span>                             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-714"></span><span>                             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-715"></span><span id="printRawCommandAndArgsAndEnv"><span class="annot"><span class="annottext">printRawCommandAndArgsAndEnv :: Verbosity
-&gt; String
-&gt; [String]
-&gt; Maybe String
-&gt; Maybe [(String, String)]
-&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#printRawCommandAndArgsAndEnv"><span class="hs-identifier hs-var hs-var">printRawCommandAndArgsAndEnv</span></a></span></span><span> </span><span id="local-6989586621679682357"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682357"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679682356"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682356"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span id="local-6989586621679682355"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682355"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span id="local-6989586621679682354"><span class="annot"><span class="annottext">Maybe String
</span><a href="#local-6989586621679682354"><span class="hs-identifier hs-var">mcwd</span></a></span></span><span> </span><span id="local-6989586621679682353"><span class="annot"><span class="annottext">Maybe [(String, String)]
</span><a href="#local-6989586621679682353"><span class="hs-identifier hs-var">menv</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-716"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe [(String, String)]
</span><a href="#local-6989586621679682353"><span class="hs-identifier hs-var">menv</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-717"></span><span>        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679682352"><span class="annot"><span class="annottext">[(String, String)]
</span><a href="#local-6989586621679682352"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#debugNoWrap"><span class="hs-identifier hs-var">debugNoWrap</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682357"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Environment: &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[(String, String)] -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">[(String, String)]
</span><a href="#local-6989586621679682352"><span class="hs-identifier hs-var">env</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-718"></span><span>        </span><span class="annot"><span class="annottext">Maybe [(String, String)]
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-719"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe String
</span><a href="#local-6989586621679682354"><span class="hs-identifier hs-var">mcwd</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-720"></span><span>        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679682351"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682351"><span class="hs-identifier hs-var">cwd</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#debugNoWrap"><span class="hs-identifier hs-var">debugNoWrap</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682357"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Working directory: &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682351"><span class="hs-identifier hs-var">cwd</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-721"></span><span>        </span><span class="annot"><span class="annottext">Maybe String
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-722"></span><span>    </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#infoNoWrap"><span class="hs-identifier hs-var">infoNoWrap</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682357"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; [String] -&gt; String
</span><a href="../../process/src/System.Process.html#showCommandForUser"><span class="hs-identifier hs-var">showCommandForUser</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682356"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682355"><span class="hs-identifier hs-var">args</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-723"></span><span>
</span><span id="line-724"></span><span class="hs-comment">-- Exit with the same exit code if the subcommand fails</span><span>
</span><span id="line-725"></span><span class="annot"><a href="Distribution.Simple.Utils.html#rawSystemExit"><span class="hs-identifier hs-type">rawSystemExit</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-726"></span><span id="rawSystemExit"><span class="annot"><span class="annottext">rawSystemExit :: Verbosity -&gt; String -&gt; [String] -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#rawSystemExit"><span class="hs-identifier hs-var hs-var">rawSystemExit</span></a></span></span><span> </span><span id="local-6989586621679682350"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682350"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679682349"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682349"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span id="local-6989586621679682348"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682348"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HasCallStack =&gt; IO ()) -&gt; IO ()
forall a. HasCallStack =&gt; (HasCallStack =&gt; a) -&gt; a
</span><a href="../../base/src/GHC.Stack.html#withFrozenCallStack"><span class="hs-identifier hs-var">withFrozenCallStack</span></a></span><span> </span><span class="annot"><span class="annottext">((HasCallStack =&gt; IO ()) -&gt; IO ())
-&gt; (HasCallStack =&gt; IO ()) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-727"></span><span>  </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; [String] -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#printRawCommandAndArgs"><span class="hs-identifier hs-var">printRawCommandAndArgs</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682350"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682349"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682348"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-728"></span><span>  </span><span class="annot"><span class="annottext">Handle -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.html#hFlush"><span class="hs-identifier hs-var">hFlush</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="../../base/src/GHC.IO.StdHandles.html#stdout"><span class="hs-identifier hs-var">stdout</span></a></span><span>
</span><span id="line-729"></span><span>  </span><span id="local-6989586621679682338"><span class="annot"><span class="annottext">ExitCode
</span><a href="#local-6989586621679682338"><span class="hs-identifier hs-var">exitcode</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; [String] -&gt; IO ExitCode
</span><a href="Distribution.Compat.Process.html#rawSystem"><span class="hs-identifier hs-var">rawSystem</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682349"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682348"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-730"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#unless"><span class="hs-identifier hs-var">unless</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ExitCode
</span><a href="#local-6989586621679682338"><span class="hs-identifier hs-var">exitcode</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCode -&gt; ExitCode -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">ExitCode
</span><a href="../../base/src/GHC.IO.Exception.html#ExitSuccess"><span class="hs-identifier hs-var">ExitSuccess</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-731"></span><span>    </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#debug"><span class="hs-identifier hs-var">debug</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682350"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; IO ()) -&gt; String -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682349"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; returned &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCode -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCode
</span><a href="#local-6989586621679682338"><span class="hs-identifier hs-var">exitcode</span></a></span><span>
</span><span id="line-732"></span><span>    </span><span class="annot"><span class="annottext">ExitCode -&gt; IO ()
forall a. ExitCode -&gt; IO a
</span><a href="../../base/src/System.Exit.html#exitWith"><span class="hs-identifier hs-var">exitWith</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCode
</span><a href="#local-6989586621679682338"><span class="hs-identifier hs-var">exitcode</span></a></span><span>
</span><span id="line-733"></span><span>
</span><span id="line-734"></span><span class="annot"><a href="Distribution.Simple.Utils.html#rawSystemExitCode"><span class="hs-identifier hs-type">rawSystemExitCode</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Exception.html#ExitCode"><span class="hs-identifier hs-type">ExitCode</span></a></span><span>
</span><span id="line-735"></span><span id="rawSystemExitCode"><span class="annot"><span class="annottext">rawSystemExitCode :: Verbosity -&gt; String -&gt; [String] -&gt; IO ExitCode
</span><a href="Distribution.Simple.Utils.html#rawSystemExitCode"><span class="hs-identifier hs-var hs-var">rawSystemExitCode</span></a></span></span><span> </span><span id="local-6989586621679682337"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682337"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679682336"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682336"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span id="local-6989586621679682335"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682335"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HasCallStack =&gt; IO ExitCode) -&gt; IO ExitCode
forall a. HasCallStack =&gt; (HasCallStack =&gt; a) -&gt; a
</span><a href="../../base/src/GHC.Stack.html#withFrozenCallStack"><span class="hs-identifier hs-var">withFrozenCallStack</span></a></span><span> </span><span class="annot"><span class="annottext">((HasCallStack =&gt; IO ExitCode) -&gt; IO ExitCode)
-&gt; (HasCallStack =&gt; IO ExitCode) -&gt; IO ExitCode
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-736"></span><span>  </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; [String] -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#printRawCommandAndArgs"><span class="hs-identifier hs-var">printRawCommandAndArgs</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682337"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682336"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682335"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-737"></span><span>  </span><span class="annot"><span class="annottext">Handle -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.html#hFlush"><span class="hs-identifier hs-var">hFlush</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="../../base/src/GHC.IO.StdHandles.html#stdout"><span class="hs-identifier hs-var">stdout</span></a></span><span>
</span><span id="line-738"></span><span>  </span><span id="local-6989586621679682325"><span class="annot"><span class="annottext">ExitCode
</span><a href="#local-6989586621679682325"><span class="hs-identifier hs-var">exitcode</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; [String] -&gt; IO ExitCode
</span><a href="Distribution.Compat.Process.html#rawSystem"><span class="hs-identifier hs-var">rawSystem</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682336"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682335"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-739"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#unless"><span class="hs-identifier hs-var">unless</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ExitCode
</span><a href="#local-6989586621679682325"><span class="hs-identifier hs-var">exitcode</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCode -&gt; ExitCode -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">ExitCode
</span><a href="../../base/src/GHC.IO.Exception.html#ExitSuccess"><span class="hs-identifier hs-var">ExitSuccess</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-740"></span><span>    </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#debug"><span class="hs-identifier hs-var">debug</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682337"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; IO ()) -&gt; String -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682336"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; returned &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCode -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCode
</span><a href="#local-6989586621679682325"><span class="hs-identifier hs-var">exitcode</span></a></span><span>
</span><span id="line-741"></span><span>  </span><span class="annot"><span class="annottext">ExitCode -&gt; IO ExitCode
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCode
</span><a href="#local-6989586621679682325"><span class="hs-identifier hs-var">exitcode</span></a></span><span>
</span><span id="line-742"></span><span>
</span><span id="line-743"></span><span class="annot"><a href="Distribution.Simple.Utils.html#rawSystemExitWithEnv"><span class="hs-identifier hs-type">rawSystemExitWithEnv</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span>
</span><span id="line-744"></span><span>                     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-745"></span><span>                     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-746"></span><span>                     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-747"></span><span>                     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-748"></span><span id="rawSystemExitWithEnv"><span class="annot"><span class="annottext">rawSystemExitWithEnv :: Verbosity -&gt; String -&gt; [String] -&gt; [(String, String)] -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#rawSystemExitWithEnv"><span class="hs-identifier hs-var hs-var">rawSystemExitWithEnv</span></a></span></span><span> </span><span id="local-6989586621679682324"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682324"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679682323"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682323"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span id="local-6989586621679682322"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682322"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span id="local-6989586621679682321"><span class="annot"><span class="annottext">[(String, String)]
</span><a href="#local-6989586621679682321"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HasCallStack =&gt; IO ()) -&gt; IO ()
forall a. HasCallStack =&gt; (HasCallStack =&gt; a) -&gt; a
</span><a href="../../base/src/GHC.Stack.html#withFrozenCallStack"><span class="hs-identifier hs-var">withFrozenCallStack</span></a></span><span> </span><span class="annot"><span class="annottext">((HasCallStack =&gt; IO ()) -&gt; IO ())
-&gt; (HasCallStack =&gt; IO ()) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-749"></span><span>    </span><span class="annot"><span class="annottext">Verbosity
-&gt; String
-&gt; [String]
-&gt; Maybe String
-&gt; Maybe [(String, String)]
-&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#printRawCommandAndArgsAndEnv"><span class="hs-identifier hs-var">printRawCommandAndArgsAndEnv</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682324"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682323"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682322"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe String
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[(String, String)] -&gt; Maybe [(String, String)]
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">[(String, String)]
</span><a href="#local-6989586621679682321"><span class="hs-identifier hs-var">env</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-750"></span><span>    </span><span class="annot"><span class="annottext">Handle -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.html#hFlush"><span class="hs-identifier hs-var">hFlush</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="../../base/src/GHC.IO.StdHandles.html#stdout"><span class="hs-identifier hs-var">stdout</span></a></span><span>
</span><span id="line-751"></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe Handle
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Maybe Handle
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Maybe Handle
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span id="local-6989586621679682311"><span class="annot"><span class="annottext">ProcessHandle
</span><a href="#local-6989586621679682311"><span class="hs-identifier hs-var">ph</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CreateProcess
-&gt; IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)
</span><a href="Distribution.Compat.Process.html#createProcess"><span class="hs-identifier hs-var">createProcess</span></a></span><span> </span><span class="annot"><span class="annottext">(CreateProcess
 -&gt; IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle))
-&gt; CreateProcess
-&gt; IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-752"></span><span>                  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; [String] -&gt; CreateProcess
</span><a href="../../process/src/System.Process.html#proc"><span class="hs-identifier hs-var">Process.proc</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682323"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682322"><span class="hs-identifier hs-var">args</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">env :: Maybe [(String, String)]
</span><a href="../../process/src/System.Process.Common.html#env"><span class="hs-identifier hs-var">Process.env</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[(String, String)] -&gt; Maybe [(String, String)]
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">[(String, String)]
</span><a href="#local-6989586621679682321"><span class="hs-identifier hs-var">env</span></a></span><span class="hs-special">)</span><span class="hs-cpp">
#ifdef MIN_VERSION_process
</span><span class="hs-cpp">#if MIN_VERSION_process(1,2,0)
</span><span class="hs-comment">-- delegate_ctlc has been added in process 1.2, and we still want to be able to</span><span>
</span><span id="line-756"></span><span class="hs-comment">-- bootstrap GHC on systems not having that version</span><span>
</span><span id="line-757"></span><span>                                           </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">delegate_ctlc :: Bool
</span><a href="../../process/src/System.Process.Common.html#delegate_ctlc"><span class="hs-identifier hs-var">Process.delegate_ctlc</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span class="hs-cpp">
#endif
</span><span class="hs-cpp">#endif
</span><span>                                           </span><span class="hs-special">}</span><span>
</span><span id="line-761"></span><span>    </span><span id="local-6989586621679682307"><span class="annot"><span class="annottext">ExitCode
</span><a href="#local-6989586621679682307"><span class="hs-identifier hs-var">exitcode</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ProcessHandle -&gt; IO ExitCode
</span><a href="../../process/src/System.Process.html#waitForProcess"><span class="hs-identifier hs-var">waitForProcess</span></a></span><span> </span><span class="annot"><span class="annottext">ProcessHandle
</span><a href="#local-6989586621679682311"><span class="hs-identifier hs-var">ph</span></a></span><span>
</span><span id="line-762"></span><span>    </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#unless"><span class="hs-identifier hs-var">unless</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ExitCode
</span><a href="#local-6989586621679682307"><span class="hs-identifier hs-var">exitcode</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCode -&gt; ExitCode -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">ExitCode
</span><a href="../../base/src/GHC.IO.Exception.html#ExitSuccess"><span class="hs-identifier hs-var">ExitSuccess</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-763"></span><span>        </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#debug"><span class="hs-identifier hs-var">debug</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682324"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; IO ()) -&gt; String -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682323"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; returned &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCode -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCode
</span><a href="#local-6989586621679682307"><span class="hs-identifier hs-var">exitcode</span></a></span><span>
</span><span id="line-764"></span><span>        </span><span class="annot"><span class="annottext">ExitCode -&gt; IO ()
forall a. ExitCode -&gt; IO a
</span><a href="../../base/src/System.Exit.html#exitWith"><span class="hs-identifier hs-var">exitWith</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCode
</span><a href="#local-6989586621679682307"><span class="hs-identifier hs-var">exitcode</span></a></span><span>
</span><span id="line-765"></span><span>
</span><span id="line-766"></span><span class="hs-comment">-- Closes the passed in handles before returning.</span><span>
</span><span id="line-767"></span><span class="annot"><a href="Distribution.Simple.Utils.html#rawSystemIOWithEnv"><span class="hs-identifier hs-type">rawSystemIOWithEnv</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span>
</span><span id="line-768"></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-769"></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-770"></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>           </span><span class="hs-comment">-- ^ New working dir or inherit</span><span>
</span><span id="line-771"></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-comment">-- ^ New environment or inherit</span><span>
</span><span id="line-772"></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Types.html#Handle"><span class="hs-identifier hs-type">Handle</span></a></span><span>  </span><span class="hs-comment">-- ^ stdin</span><span>
</span><span id="line-773"></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Types.html#Handle"><span class="hs-identifier hs-type">Handle</span></a></span><span>  </span><span class="hs-comment">-- ^ stdout</span><span>
</span><span id="line-774"></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Types.html#Handle"><span class="hs-identifier hs-type">Handle</span></a></span><span>  </span><span class="hs-comment">-- ^ stderr</span><span>
</span><span id="line-775"></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Exception.html#ExitCode"><span class="hs-identifier hs-type">ExitCode</span></a></span><span>
</span><span id="line-776"></span><span id="rawSystemIOWithEnv"><span class="annot"><span class="annottext">rawSystemIOWithEnv :: Verbosity
-&gt; String
-&gt; [String]
-&gt; Maybe String
-&gt; Maybe [(String, String)]
-&gt; Maybe Handle
-&gt; Maybe Handle
-&gt; Maybe Handle
-&gt; IO ExitCode
</span><a href="Distribution.Simple.Utils.html#rawSystemIOWithEnv"><span class="hs-identifier hs-var hs-var">rawSystemIOWithEnv</span></a></span></span><span> </span><span id="local-6989586621679682306"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682306"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679682305"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682305"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span id="local-6989586621679682304"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682304"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span id="local-6989586621679682303"><span class="annot"><span class="annottext">Maybe String
</span><a href="#local-6989586621679682303"><span class="hs-identifier hs-var">mcwd</span></a></span></span><span> </span><span id="local-6989586621679682302"><span class="annot"><span class="annottext">Maybe [(String, String)]
</span><a href="#local-6989586621679682302"><span class="hs-identifier hs-var">menv</span></a></span></span><span> </span><span id="local-6989586621679682301"><span class="annot"><span class="annottext">Maybe Handle
</span><a href="#local-6989586621679682301"><span class="hs-identifier hs-var">inp</span></a></span></span><span> </span><span id="local-6989586621679682300"><span class="annot"><span class="annottext">Maybe Handle
</span><a href="#local-6989586621679682300"><span class="hs-identifier hs-var">out</span></a></span></span><span> </span><span id="local-6989586621679682299"><span class="annot"><span class="annottext">Maybe Handle
</span><a href="#local-6989586621679682299"><span class="hs-identifier hs-var">err</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HasCallStack =&gt; IO ExitCode) -&gt; IO ExitCode
forall a. HasCallStack =&gt; (HasCallStack =&gt; a) -&gt; a
</span><a href="../../base/src/GHC.Stack.html#withFrozenCallStack"><span class="hs-identifier hs-var">withFrozenCallStack</span></a></span><span> </span><span class="annot"><span class="annottext">((HasCallStack =&gt; IO ExitCode) -&gt; IO ExitCode)
-&gt; (HasCallStack =&gt; IO ExitCode) -&gt; IO ExitCode
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-777"></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe Handle
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Maybe Handle
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Maybe Handle
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span id="local-6989586621679682290"><span class="annot"><span class="annottext">ProcessHandle
</span><a href="#local-6989586621679682290"><span class="hs-identifier hs-var">ph</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Verbosity
-&gt; String
-&gt; [String]
-&gt; Maybe String
-&gt; Maybe [(String, String)]
-&gt; StdStream
-&gt; StdStream
-&gt; StdStream
-&gt; IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)
</span><a href="Distribution.Simple.Utils.html#createProcessWithEnv"><span class="hs-identifier hs-var">createProcessWithEnv</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682306"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682305"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682304"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe String
</span><a href="#local-6989586621679682303"><span class="hs-identifier hs-var">mcwd</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe [(String, String)]
</span><a href="#local-6989586621679682302"><span class="hs-identifier hs-var">menv</span></a></span><span>
</span><span id="line-778"></span><span>                                       </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe Handle -&gt; StdStream
</span><a href="#local-6989586621679682289"><span class="hs-identifier hs-var">mbToStd</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Handle
</span><a href="#local-6989586621679682301"><span class="hs-identifier hs-var">inp</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe Handle -&gt; StdStream
</span><a href="#local-6989586621679682289"><span class="hs-identifier hs-var">mbToStd</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Handle
</span><a href="#local-6989586621679682300"><span class="hs-identifier hs-var">out</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe Handle -&gt; StdStream
</span><a href="#local-6989586621679682289"><span class="hs-identifier hs-var">mbToStd</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Handle
</span><a href="#local-6989586621679682299"><span class="hs-identifier hs-var">err</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-779"></span><span>    </span><span id="local-6989586621679682288"><span class="annot"><span class="annottext">ExitCode
</span><a href="#local-6989586621679682288"><span class="hs-identifier hs-var">exitcode</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ProcessHandle -&gt; IO ExitCode
</span><a href="../../process/src/System.Process.html#waitForProcess"><span class="hs-identifier hs-var">waitForProcess</span></a></span><span> </span><span class="annot"><span class="annottext">ProcessHandle
</span><a href="#local-6989586621679682290"><span class="hs-identifier hs-var">ph</span></a></span><span>
</span><span id="line-780"></span><span>    </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#unless"><span class="hs-identifier hs-var">unless</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ExitCode
</span><a href="#local-6989586621679682288"><span class="hs-identifier hs-var">exitcode</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCode -&gt; ExitCode -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">ExitCode
</span><a href="../../base/src/GHC.IO.Exception.html#ExitSuccess"><span class="hs-identifier hs-var">ExitSuccess</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-781"></span><span>      </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#debug"><span class="hs-identifier hs-var">debug</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682306"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; IO ()) -&gt; String -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682305"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; returned &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCode -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCode
</span><a href="#local-6989586621679682288"><span class="hs-identifier hs-var">exitcode</span></a></span><span>
</span><span id="line-782"></span><span>    </span><span class="annot"><span class="annottext">ExitCode -&gt; IO ExitCode
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCode
</span><a href="#local-6989586621679682288"><span class="hs-identifier hs-var">exitcode</span></a></span><span>
</span><span id="line-783"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-784"></span><span>    </span><span class="annot"><a href="#local-6989586621679682289"><span class="hs-identifier hs-type">mbToStd</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Types.html#Handle"><span class="hs-identifier hs-type">Handle</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../process/src/System.Process.Common.html#StdStream"><span class="hs-identifier hs-type">Process.StdStream</span></a></span><span>
</span><span id="line-785"></span><span>    </span><span id="local-6989586621679682289"><span class="annot"><span class="annottext">mbToStd :: Maybe Handle -&gt; StdStream
</span><a href="#local-6989586621679682289"><span class="hs-identifier hs-var hs-var">mbToStd</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">StdStream -&gt; (Handle -&gt; StdStream) -&gt; Maybe Handle -&gt; StdStream
forall b a. b -&gt; (a -&gt; b) -&gt; Maybe a -&gt; b
</span><a href="../../base/src/Data.Maybe.html#maybe"><span class="hs-identifier hs-var">maybe</span></a></span><span> </span><span class="annot"><span class="annottext">StdStream
</span><a href="../../process/src/System.Process.Common.html#Inherit"><span class="hs-identifier hs-var">Process.Inherit</span></a></span><span> </span><span class="annot"><span class="annottext">Handle -&gt; StdStream
</span><a href="../../process/src/System.Process.Common.html#UseHandle"><span class="hs-identifier hs-var">Process.UseHandle</span></a></span><span>
</span><span id="line-786"></span><span>
</span><span id="line-787"></span><span id="local-6989586621679683129"><span class="annot"><a href="Distribution.Simple.Utils.html#rawSystemIOWithEnvAndAction"><span class="hs-identifier hs-type">rawSystemIOWithEnvAndAction</span></a></span><span>
</span><span id="line-788"></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span>
</span><span id="line-789"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-790"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-791"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>           </span><span class="hs-comment">-- ^ New working dir or inherit</span><span>
</span><span id="line-792"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-comment">-- ^ New environment or inherit</span><span>
</span><span id="line-793"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621679683129"><span class="hs-identifier hs-type">a</span></a></span><span>          </span><span class="hs-comment">-- ^ action to perform after process is created, but before 'waitForProcess'.</span><span>
</span><span id="line-794"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Types.html#Handle"><span class="hs-identifier hs-type">Handle</span></a></span><span>  </span><span class="hs-comment">-- ^ stdin</span><span>
</span><span id="line-795"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Types.html#Handle"><span class="hs-identifier hs-type">Handle</span></a></span><span>  </span><span class="hs-comment">-- ^ stdout</span><span>
</span><span id="line-796"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Types.html#Handle"><span class="hs-identifier hs-type">Handle</span></a></span><span>  </span><span class="hs-comment">-- ^ stderr</span><span>
</span><span id="line-797"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IO.Exception.html#ExitCode"><span class="hs-identifier hs-type">ExitCode</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679683129"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-798"></span><span id="rawSystemIOWithEnvAndAction"><span class="annot"><span class="annottext">rawSystemIOWithEnvAndAction :: forall a.
Verbosity
-&gt; String
-&gt; [String]
-&gt; Maybe String
-&gt; Maybe [(String, String)]
-&gt; IO a
-&gt; Maybe Handle
-&gt; Maybe Handle
-&gt; Maybe Handle
-&gt; IO (ExitCode, a)
</span><a href="Distribution.Simple.Utils.html#rawSystemIOWithEnvAndAction"><span class="hs-identifier hs-var hs-var">rawSystemIOWithEnvAndAction</span></a></span></span><span> </span><span id="local-6989586621679682282"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682282"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679682281"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682281"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span id="local-6989586621679682280"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682280"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span id="local-6989586621679682279"><span class="annot"><span class="annottext">Maybe String
</span><a href="#local-6989586621679682279"><span class="hs-identifier hs-var">mcwd</span></a></span></span><span> </span><span id="local-6989586621679682278"><span class="annot"><span class="annottext">Maybe [(String, String)]
</span><a href="#local-6989586621679682278"><span class="hs-identifier hs-var">menv</span></a></span></span><span> </span><span id="local-6989586621679682277"><span class="annot"><span class="annottext">IO a
</span><a href="#local-6989586621679682277"><span class="hs-identifier hs-var">action</span></a></span></span><span> </span><span id="local-6989586621679682276"><span class="annot"><span class="annottext">Maybe Handle
</span><a href="#local-6989586621679682276"><span class="hs-identifier hs-var">inp</span></a></span></span><span> </span><span id="local-6989586621679682275"><span class="annot"><span class="annottext">Maybe Handle
</span><a href="#local-6989586621679682275"><span class="hs-identifier hs-var">out</span></a></span></span><span> </span><span id="local-6989586621679682274"><span class="annot"><span class="annottext">Maybe Handle
</span><a href="#local-6989586621679682274"><span class="hs-identifier hs-var">err</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HasCallStack =&gt; IO (ExitCode, a)) -&gt; IO (ExitCode, a)
forall a. HasCallStack =&gt; (HasCallStack =&gt; a) -&gt; a
</span><a href="../../base/src/GHC.Stack.html#withFrozenCallStack"><span class="hs-identifier hs-var">withFrozenCallStack</span></a></span><span> </span><span class="annot"><span class="annottext">((HasCallStack =&gt; IO (ExitCode, a)) -&gt; IO (ExitCode, a))
-&gt; (HasCallStack =&gt; IO (ExitCode, a)) -&gt; IO (ExitCode, a)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-799"></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe Handle
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Maybe Handle
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Maybe Handle
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span id="local-6989586621679682264"><span class="annot"><span class="annottext">ProcessHandle
</span><a href="#local-6989586621679682264"><span class="hs-identifier hs-var">ph</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Verbosity
-&gt; String
-&gt; [String]
-&gt; Maybe String
-&gt; Maybe [(String, String)]
-&gt; StdStream
-&gt; StdStream
-&gt; StdStream
-&gt; IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)
</span><a href="Distribution.Simple.Utils.html#createProcessWithEnv"><span class="hs-identifier hs-var">createProcessWithEnv</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682282"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682281"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682280"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe String
</span><a href="#local-6989586621679682279"><span class="hs-identifier hs-var">mcwd</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe [(String, String)]
</span><a href="#local-6989586621679682278"><span class="hs-identifier hs-var">menv</span></a></span><span>
</span><span id="line-800"></span><span>                                       </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe Handle -&gt; StdStream
</span><a href="#local-6989586621679682263"><span class="hs-identifier hs-var">mbToStd</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Handle
</span><a href="#local-6989586621679682276"><span class="hs-identifier hs-var">inp</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe Handle -&gt; StdStream
</span><a href="#local-6989586621679682263"><span class="hs-identifier hs-var">mbToStd</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Handle
</span><a href="#local-6989586621679682275"><span class="hs-identifier hs-var">out</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe Handle -&gt; StdStream
</span><a href="#local-6989586621679682263"><span class="hs-identifier hs-var">mbToStd</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Handle
</span><a href="#local-6989586621679682274"><span class="hs-identifier hs-var">err</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-801"></span><span>    </span><span id="local-6989586621679682262"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679682262"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO a
</span><a href="#local-6989586621679682277"><span class="hs-identifier hs-var">action</span></a></span><span>
</span><span id="line-802"></span><span>    </span><span id="local-6989586621679682261"><span class="annot"><span class="annottext">ExitCode
</span><a href="#local-6989586621679682261"><span class="hs-identifier hs-var">exitcode</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ProcessHandle -&gt; IO ExitCode
</span><a href="../../process/src/System.Process.html#waitForProcess"><span class="hs-identifier hs-var">waitForProcess</span></a></span><span> </span><span class="annot"><span class="annottext">ProcessHandle
</span><a href="#local-6989586621679682264"><span class="hs-identifier hs-var">ph</span></a></span><span>
</span><span id="line-803"></span><span>    </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#unless"><span class="hs-identifier hs-var">unless</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ExitCode
</span><a href="#local-6989586621679682261"><span class="hs-identifier hs-var">exitcode</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCode -&gt; ExitCode -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">ExitCode
</span><a href="../../base/src/GHC.IO.Exception.html#ExitSuccess"><span class="hs-identifier hs-var">ExitSuccess</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-804"></span><span>      </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#debug"><span class="hs-identifier hs-var">debug</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682282"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; IO ()) -&gt; String -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682281"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; returned &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCode -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCode
</span><a href="#local-6989586621679682261"><span class="hs-identifier hs-var">exitcode</span></a></span><span>
</span><span id="line-805"></span><span>    </span><span class="annot"><span class="annottext">(ExitCode, a) -&gt; IO (ExitCode, a)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ExitCode
</span><a href="#local-6989586621679682261"><span class="hs-identifier hs-var">exitcode</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679682262"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-806"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-807"></span><span>    </span><span class="annot"><a href="#local-6989586621679682263"><span class="hs-identifier hs-type">mbToStd</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Types.html#Handle"><span class="hs-identifier hs-type">Handle</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../process/src/System.Process.Common.html#StdStream"><span class="hs-identifier hs-type">Process.StdStream</span></a></span><span>
</span><span id="line-808"></span><span>    </span><span id="local-6989586621679682263"><span class="annot"><span class="annottext">mbToStd :: Maybe Handle -&gt; StdStream
</span><a href="#local-6989586621679682263"><span class="hs-identifier hs-var hs-var">mbToStd</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">StdStream -&gt; (Handle -&gt; StdStream) -&gt; Maybe Handle -&gt; StdStream
forall b a. b -&gt; (a -&gt; b) -&gt; Maybe a -&gt; b
</span><a href="../../base/src/Data.Maybe.html#maybe"><span class="hs-identifier hs-var">maybe</span></a></span><span> </span><span class="annot"><span class="annottext">StdStream
</span><a href="../../process/src/System.Process.Common.html#Inherit"><span class="hs-identifier hs-var">Process.Inherit</span></a></span><span> </span><span class="annot"><span class="annottext">Handle -&gt; StdStream
</span><a href="../../process/src/System.Process.Common.html#UseHandle"><span class="hs-identifier hs-var">Process.UseHandle</span></a></span><span>
</span><span id="line-809"></span><span>
</span><span id="line-810"></span><span class="annot"><a href="Distribution.Simple.Utils.html#createProcessWithEnv"><span class="hs-identifier hs-type">createProcessWithEnv</span></a></span><span> </span><span class="hs-glyph">::</span><span>
</span><span id="line-811"></span><span>     </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span>
</span><span id="line-812"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-813"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-814"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>           </span><span class="hs-comment">-- ^ New working dir or inherit</span><span>
</span><span id="line-815"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-comment">-- ^ New environment or inherit</span><span>
</span><span id="line-816"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../process/src/System.Process.Common.html#StdStream"><span class="hs-identifier hs-type">Process.StdStream</span></a></span><span>  </span><span class="hs-comment">-- ^ stdin</span><span>
</span><span id="line-817"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../process/src/System.Process.Common.html#StdStream"><span class="hs-identifier hs-type">Process.StdStream</span></a></span><span>  </span><span class="hs-comment">-- ^ stdout</span><span>
</span><span id="line-818"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../process/src/System.Process.Common.html#StdStream"><span class="hs-identifier hs-type">Process.StdStream</span></a></span><span>  </span><span class="hs-comment">-- ^ stderr</span><span>
</span><span id="line-819"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Types.html#Handle"><span class="hs-identifier hs-type">Handle</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Types.html#Handle"><span class="hs-identifier hs-type">Handle</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Types.html#Handle"><span class="hs-identifier hs-type">Handle</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../process/src/System.Process.Common.html#ProcessHandle"><span class="hs-identifier hs-type">ProcessHandle</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-820"></span><span>  </span><span class="hs-comment">-- ^ Any handles created for stdin, stdout, or stderr</span><span>
</span><span id="line-821"></span><span>  </span><span class="hs-comment">-- with 'CreateProcess', and a handle to the process.</span><span>
</span><span id="line-822"></span><span id="createProcessWithEnv"><span class="annot"><span class="annottext">createProcessWithEnv :: Verbosity
-&gt; String
-&gt; [String]
-&gt; Maybe String
-&gt; Maybe [(String, String)]
-&gt; StdStream
-&gt; StdStream
-&gt; StdStream
-&gt; IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)
</span><a href="Distribution.Simple.Utils.html#createProcessWithEnv"><span class="hs-identifier hs-var hs-var">createProcessWithEnv</span></a></span></span><span> </span><span id="local-6989586621679682260"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682260"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679682259"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682259"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span id="local-6989586621679682258"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682258"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span id="local-6989586621679682257"><span class="annot"><span class="annottext">Maybe String
</span><a href="#local-6989586621679682257"><span class="hs-identifier hs-var">mcwd</span></a></span></span><span> </span><span id="local-6989586621679682256"><span class="annot"><span class="annottext">Maybe [(String, String)]
</span><a href="#local-6989586621679682256"><span class="hs-identifier hs-var">menv</span></a></span></span><span> </span><span id="local-6989586621679682255"><span class="annot"><span class="annottext">StdStream
</span><a href="#local-6989586621679682255"><span class="hs-identifier hs-var">inp</span></a></span></span><span> </span><span id="local-6989586621679682254"><span class="annot"><span class="annottext">StdStream
</span><a href="#local-6989586621679682254"><span class="hs-identifier hs-var">out</span></a></span></span><span> </span><span id="local-6989586621679682253"><span class="annot"><span class="annottext">StdStream
</span><a href="#local-6989586621679682253"><span class="hs-identifier hs-var">err</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HasCallStack =&gt;
 IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle))
-&gt; IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)
forall a. HasCallStack =&gt; (HasCallStack =&gt; a) -&gt; a
</span><a href="../../base/src/GHC.Stack.html#withFrozenCallStack"><span class="hs-identifier hs-var">withFrozenCallStack</span></a></span><span> </span><span class="annot"><span class="annottext">((HasCallStack =&gt;
  IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle))
 -&gt; IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle))
-&gt; (HasCallStack =&gt;
    IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle))
-&gt; IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-823"></span><span>    </span><span class="annot"><span class="annottext">Verbosity
-&gt; String
-&gt; [String]
-&gt; Maybe String
-&gt; Maybe [(String, String)]
-&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#printRawCommandAndArgsAndEnv"><span class="hs-identifier hs-var">printRawCommandAndArgsAndEnv</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682260"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682259"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682258"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe String
</span><a href="#local-6989586621679682257"><span class="hs-identifier hs-var">mcwd</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe [(String, String)]
</span><a href="#local-6989586621679682256"><span class="hs-identifier hs-var">menv</span></a></span><span>
</span><span id="line-824"></span><span>    </span><span class="annot"><span class="annottext">Handle -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.html#hFlush"><span class="hs-identifier hs-var">hFlush</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="../../base/src/GHC.IO.StdHandles.html#stdout"><span class="hs-identifier hs-var">stdout</span></a></span><span>
</span><span id="line-825"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621679682247"><span class="annot"><span class="annottext">Maybe Handle
</span><a href="#local-6989586621679682247"><span class="hs-identifier hs-var">inp'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679682246"><span class="annot"><span class="annottext">Maybe Handle
</span><a href="#local-6989586621679682246"><span class="hs-identifier hs-var">out'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679682245"><span class="annot"><span class="annottext">Maybe Handle
</span><a href="#local-6989586621679682245"><span class="hs-identifier hs-var">err'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679682244"><span class="annot"><span class="annottext">ProcessHandle
</span><a href="#local-6989586621679682244"><span class="hs-identifier hs-var">ph</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CreateProcess
-&gt; IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)
</span><a href="Distribution.Compat.Process.html#createProcess"><span class="hs-identifier hs-var">createProcess</span></a></span><span> </span><span class="annot"><span class="annottext">(CreateProcess
 -&gt; IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle))
-&gt; CreateProcess
-&gt; IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-826"></span><span>                                </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; [String] -&gt; CreateProcess
</span><a href="../../process/src/System.Process.html#proc"><span class="hs-identifier hs-var">Process.proc</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682259"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682258"><span class="hs-identifier hs-var">args</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-827"></span><span>                                    </span><span class="annot"><span class="annottext">cwd :: Maybe String
</span><a href="../../process/src/System.Process.Common.html#cwd"><span class="hs-identifier hs-var">Process.cwd</span></a></span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe String
</span><a href="#local-6989586621679682257"><span class="hs-identifier hs-var">mcwd</span></a></span><span>
</span><span id="line-828"></span><span>                                  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">env :: Maybe [(String, String)]
</span><a href="../../process/src/System.Process.Common.html#env"><span class="hs-identifier hs-var">Process.env</span></a></span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe [(String, String)]
</span><a href="#local-6989586621679682256"><span class="hs-identifier hs-var">menv</span></a></span><span>
</span><span id="line-829"></span><span>                                  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">std_in :: StdStream
</span><a href="../../process/src/System.Process.Common.html#std_in"><span class="hs-identifier hs-var">Process.std_in</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">StdStream
</span><a href="#local-6989586621679682255"><span class="hs-identifier hs-var">inp</span></a></span><span>
</span><span id="line-830"></span><span>                                  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">std_out :: StdStream
</span><a href="../../process/src/System.Process.Common.html#std_out"><span class="hs-identifier hs-var">Process.std_out</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">StdStream
</span><a href="#local-6989586621679682254"><span class="hs-identifier hs-var">out</span></a></span><span>
</span><span id="line-831"></span><span>                                  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">std_err :: StdStream
</span><a href="../../process/src/System.Process.Common.html#std_err"><span class="hs-identifier hs-var">Process.std_err</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">StdStream
</span><a href="#local-6989586621679682253"><span class="hs-identifier hs-var">err</span></a></span><span class="hs-cpp">
#ifdef MIN_VERSION_process
</span><span class="hs-cpp">#if MIN_VERSION_process(1,2,0)
</span><span class="hs-comment">-- delegate_ctlc has been added in process 1.2, and we still want to be able to</span><span>
</span><span id="line-835"></span><span class="hs-comment">-- bootstrap GHC on systems not having that version</span><span>
</span><span id="line-836"></span><span>                                  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">delegate_ctlc :: Bool
</span><a href="../../process/src/System.Process.Common.html#delegate_ctlc"><span class="hs-identifier hs-var">Process.delegate_ctlc</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span class="hs-cpp">
#endif
</span><span class="hs-cpp">#endif
</span><span>                                  </span><span class="hs-special">}</span><span>
</span><span id="line-840"></span><span>    </span><span class="annot"><span class="annottext">(Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)
-&gt; IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe Handle
</span><a href="#local-6989586621679682247"><span class="hs-identifier hs-var">inp'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Maybe Handle
</span><a href="#local-6989586621679682246"><span class="hs-identifier hs-var">out'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Maybe Handle
</span><a href="#local-6989586621679682245"><span class="hs-identifier hs-var">err'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ProcessHandle
</span><a href="#local-6989586621679682244"><span class="hs-identifier hs-var">ph</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-841"></span><span>
</span><span id="line-842"></span><span class="hs-comment">-- | Run a command and return its output.</span><span>
</span><span id="line-843"></span><span class="hs-comment">--</span><span>
</span><span id="line-844"></span><span class="hs-comment">-- The output is assumed to be text in the locale encoding.</span><span>
</span><span id="line-845"></span><span class="hs-comment">--</span><span>
</span><span id="line-846"></span><span class="annot"><a href="Distribution.Simple.Utils.html#rawSystemStdout"><span class="hs-identifier hs-type">rawSystemStdout</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621679683127"><span class="annot"><a href="#local-6989586621679683127"><span class="hs-identifier hs-type">mode</span></a></span></span><span class="hs-operator">.</span><span> </span><span class="annot"><a href="Distribution.Utils.IOData.html#KnownIODataMode"><span class="hs-identifier hs-type">KnownIODataMode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679683127"><span class="hs-identifier hs-type">mode</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621679683127"><span class="hs-identifier hs-type">mode</span></a></span><span>
</span><span id="line-847"></span><span id="rawSystemStdout"><span class="annot"><span class="annottext">rawSystemStdout :: forall mode.
KnownIODataMode mode =&gt;
Verbosity -&gt; String -&gt; [String] -&gt; IO mode
</span><a href="Distribution.Simple.Utils.html#rawSystemStdout"><span class="hs-identifier hs-var hs-var">rawSystemStdout</span></a></span></span><span> </span><span id="local-6989586621679682236"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682236"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679682235"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682235"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span id="local-6989586621679682234"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682234"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HasCallStack =&gt; IO mode) -&gt; IO mode
forall a. HasCallStack =&gt; (HasCallStack =&gt; a) -&gt; a
</span><a href="../../base/src/GHC.Stack.html#withFrozenCallStack"><span class="hs-identifier hs-var">withFrozenCallStack</span></a></span><span> </span><span class="annot"><span class="annottext">((HasCallStack =&gt; IO mode) -&gt; IO mode)
-&gt; (HasCallStack =&gt; IO mode) -&gt; IO mode
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-848"></span><span>  </span><span class="hs-special">(</span><span id="local-6989586621679682225"><span class="annot"><span class="annottext">mode
</span><a href="#local-6989586621679682225"><span class="hs-identifier hs-var">output</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679682224"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682224"><span class="hs-identifier hs-var">errors</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679682223"><span class="annot"><span class="annottext">ExitCode
</span><a href="#local-6989586621679682223"><span class="hs-identifier hs-var">exitCode</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Verbosity
-&gt; String
-&gt; [String]
-&gt; Maybe String
-&gt; Maybe [(String, String)]
-&gt; Maybe IOData
-&gt; IODataMode mode
-&gt; IO (mode, String, ExitCode)
forall mode.
KnownIODataMode mode =&gt;
Verbosity
-&gt; String
-&gt; [String]
-&gt; Maybe String
-&gt; Maybe [(String, String)]
-&gt; Maybe IOData
-&gt; IODataMode mode
-&gt; IO (mode, String, ExitCode)
</span><a href="Distribution.Simple.Utils.html#rawSystemStdInOut"><span class="hs-identifier hs-var">rawSystemStdInOut</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682236"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682235"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682234"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-849"></span><span>    </span><span class="annot"><span class="annottext">Maybe String
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe [(String, String)]
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe IOData
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IODataMode mode
forall mode. KnownIODataMode mode =&gt; IODataMode mode
</span><a href="Distribution.Utils.IOData.html#iodataMode"><span class="hs-identifier hs-var">IOData.iodataMode</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Utils.IOData.html#IODataMode"><span class="hs-identifier hs-type">IODataMode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679683127"><span class="hs-identifier hs-type">mode</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-850"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ExitCode
</span><a href="#local-6989586621679682223"><span class="hs-identifier hs-var">exitCode</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCode -&gt; ExitCode -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">ExitCode
</span><a href="../../base/src/GHC.IO.Exception.html#ExitSuccess"><span class="hs-identifier hs-var">ExitSuccess</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-851"></span><span>    </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; IO ()
forall a. Verbosity -&gt; String -&gt; IO a
</span><a href="Distribution.Simple.Utils.html#die%27"><span class="hs-identifier hs-var">die'</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682236"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682224"><span class="hs-identifier hs-var">errors</span></a></span><span>
</span><span id="line-852"></span><span>  </span><span class="annot"><span class="annottext">mode -&gt; IO mode
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">mode
</span><a href="#local-6989586621679682225"><span class="hs-identifier hs-var">output</span></a></span><span>
</span><span id="line-853"></span><span>
</span><span id="line-854"></span><span class="hs-comment">-- | Run a command and return its output, errors and exit status. Optionally</span><span>
</span><span id="line-855"></span><span class="hs-comment">-- also supply some input. Also provides control over whether the binary/text</span><span>
</span><span id="line-856"></span><span class="hs-comment">-- mode of the input and output.</span><span>
</span><span id="line-857"></span><span class="hs-comment">--</span><span>
</span><span id="line-858"></span><span id="local-6989586621679683122"><span class="annot"><a href="Distribution.Simple.Utils.html#rawSystemStdInOut"><span class="hs-identifier hs-type">rawSystemStdInOut</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Utils.IOData.html#KnownIODataMode"><span class="hs-identifier hs-type">KnownIODataMode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679683122"><span class="hs-identifier hs-type">mode</span></a></span><span>
</span><span id="line-859"></span><span>                  </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span>
</span><span id="line-860"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>                 </span><span class="hs-comment">-- ^ Program location</span><span>
</span><span id="line-861"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span>                 </span><span class="hs-comment">-- ^ Arguments</span><span>
</span><span id="line-862"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>           </span><span class="hs-comment">-- ^ New working dir or inherit</span><span>
</span><span id="line-863"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-comment">-- ^ New environment or inherit</span><span>
</span><span id="line-864"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="Distribution.Utils.IOData.html#IOData"><span class="hs-identifier hs-type">IOData</span></a></span><span>             </span><span class="hs-comment">-- ^ input text and binary mode</span><span>
</span><span id="line-865"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Utils.IOData.html#IODataMode"><span class="hs-identifier hs-type">IODataMode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679683122"><span class="hs-identifier hs-type">mode</span></a></span><span>          </span><span class="hs-comment">-- ^ iodata mode, acts as proxy</span><span>
</span><span id="line-866"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679683122"><span class="hs-identifier hs-type">mode</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Exception.html#ExitCode"><span class="hs-identifier hs-type">ExitCode</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-comment">-- ^ output, errors, exit</span><span>
</span><span id="line-867"></span><span id="rawSystemStdInOut"><span class="annot"><span class="annottext">rawSystemStdInOut :: forall mode.
KnownIODataMode mode =&gt;
Verbosity
-&gt; String
-&gt; [String]
-&gt; Maybe String
-&gt; Maybe [(String, String)]
-&gt; Maybe IOData
-&gt; IODataMode mode
-&gt; IO (mode, String, ExitCode)
</span><a href="Distribution.Simple.Utils.html#rawSystemStdInOut"><span class="hs-identifier hs-var hs-var">rawSystemStdInOut</span></a></span></span><span> </span><span id="local-6989586621679682210"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682210"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679682209"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682209"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span id="local-6989586621679682208"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682208"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span id="local-6989586621679682207"><span class="annot"><span class="annottext">Maybe String
</span><a href="#local-6989586621679682207"><span class="hs-identifier hs-var">mcwd</span></a></span></span><span> </span><span id="local-6989586621679682206"><span class="annot"><span class="annottext">Maybe [(String, String)]
</span><a href="#local-6989586621679682206"><span class="hs-identifier hs-var">menv</span></a></span></span><span> </span><span id="local-6989586621679682205"><span class="annot"><span class="annottext">Maybe IOData
</span><a href="#local-6989586621679682205"><span class="hs-identifier hs-var">input</span></a></span></span><span> </span><span class="annot"><span class="annottext">IODataMode mode
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HasCallStack =&gt; IO (mode, String, ExitCode))
-&gt; IO (mode, String, ExitCode)
forall a. HasCallStack =&gt; (HasCallStack =&gt; a) -&gt; a
</span><a href="../../base/src/GHC.Stack.html#withFrozenCallStack"><span class="hs-identifier hs-var">withFrozenCallStack</span></a></span><span> </span><span class="annot"><span class="annottext">((HasCallStack =&gt; IO (mode, String, ExitCode))
 -&gt; IO (mode, String, ExitCode))
-&gt; (HasCallStack =&gt; IO (mode, String, ExitCode))
-&gt; IO (mode, String, ExitCode)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-868"></span><span>  </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; [String] -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#printRawCommandAndArgs"><span class="hs-identifier hs-var">printRawCommandAndArgs</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682210"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682209"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682208"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-869"></span><span>
</span><span id="line-870"></span><span>  </span><span class="annot"><span class="annottext">IO (Handle, Handle, Handle, ProcessHandle)
-&gt; ((Handle, Handle, Handle, ProcessHandle) -&gt; IO ())
-&gt; ((Handle, Handle, Handle, ProcessHandle)
    -&gt; IO (mode, String, ExitCode))
-&gt; IO (mode, String, ExitCode)
forall a b c. IO a -&gt; (a -&gt; IO b) -&gt; (a -&gt; IO c) -&gt; IO c
</span><a href="../../base/src/Control.Exception.Base.html#bracket"><span class="hs-identifier hs-var">Exception.bracket</span></a></span><span>
</span><span id="line-871"></span><span>     </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
-&gt; [String]
-&gt; Maybe String
-&gt; Maybe [(String, String)]
-&gt; IO (Handle, Handle, Handle, ProcessHandle)
</span><a href="Distribution.Compat.Process.html#runInteractiveProcess"><span class="hs-identifier hs-var">runInteractiveProcess</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682209"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682208"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe String
</span><a href="#local-6989586621679682207"><span class="hs-identifier hs-var">mcwd</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe [(String, String)]
</span><a href="#local-6989586621679682206"><span class="hs-identifier hs-var">menv</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-872"></span><span>     </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621679682178"><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679682178"><span class="hs-identifier hs-var">inh</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679682177"><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679682177"><span class="hs-identifier hs-var">outh</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679682176"><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679682176"><span class="hs-identifier hs-var">errh</span></a></span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">ProcessHandle
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Handle -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.html#hClose"><span class="hs-identifier hs-var">hClose</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679682178"><span class="hs-identifier hs-var">inh</span></a></span><span> </span><span class="annot"><span class="annottext">IO () -&gt; IO () -&gt; IO ()
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; m b -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E"><span class="hs-operator hs-var">&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Handle -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.html#hClose"><span class="hs-identifier hs-var">hClose</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679682177"><span class="hs-identifier hs-var">outh</span></a></span><span> </span><span class="annot"><span class="annottext">IO () -&gt; IO () -&gt; IO ()
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; m b -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E"><span class="hs-operator hs-var">&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Handle -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.html#hClose"><span class="hs-identifier hs-var">hClose</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679682176"><span class="hs-identifier hs-var">errh</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-873"></span><span>    </span><span class="annot"><span class="annottext">(((Handle, Handle, Handle, ProcessHandle)
  -&gt; IO (mode, String, ExitCode))
 -&gt; IO (mode, String, ExitCode))
-&gt; ((Handle, Handle, Handle, ProcessHandle)
    -&gt; IO (mode, String, ExitCode))
-&gt; IO (mode, String, ExitCode)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621679682175"><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679682175"><span class="hs-identifier hs-var">inh</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679682174"><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679682174"><span class="hs-identifier hs-var">outh</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679682173"><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679682173"><span class="hs-identifier hs-var">errh</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679682172"><span class="annot"><span class="annottext">ProcessHandle
</span><a href="#local-6989586621679682172"><span class="hs-identifier hs-var">pid</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-874"></span><span>
</span><span id="line-875"></span><span>      </span><span class="hs-comment">-- output mode depends on what the caller wants</span><span>
</span><span id="line-876"></span><span>      </span><span class="hs-comment">-- but the errors are always assumed to be text (in the current locale)</span><span>
</span><span id="line-877"></span><span>      </span><span class="annot"><span class="annottext">Handle -&gt; Bool -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.html#hSetBinaryMode"><span class="hs-identifier hs-var">hSetBinaryMode</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679682173"><span class="hs-identifier hs-var">errh</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-878"></span><span>
</span><span id="line-879"></span><span>      </span><span class="hs-comment">-- fork off a couple threads to pull on the stderr and stdout</span><span>
</span><span id="line-880"></span><span>      </span><span class="hs-comment">-- so if the process writes to stderr we do not block.</span><span>
</span><span id="line-881"></span><span>
</span><span id="line-882"></span><span>      </span><span class="annot"><span class="annottext">IO String
-&gt; (AsyncM String -&gt; IO (mode, String, ExitCode))
-&gt; IO (mode, String, ExitCode)
forall a b. NFData a =&gt; IO a -&gt; (AsyncM a -&gt; IO b) -&gt; IO b
</span><a href="Distribution.Compat.Async.html#withAsyncNF"><span class="hs-identifier hs-var">withAsyncNF</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Handle -&gt; IO String
</span><a href="../../base/src/GHC.IO.Handle.Text.html#hGetContents"><span class="hs-identifier hs-var">hGetContents</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679682173"><span class="hs-identifier hs-var">errh</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">((AsyncM String -&gt; IO (mode, String, ExitCode))
 -&gt; IO (mode, String, ExitCode))
-&gt; (AsyncM String -&gt; IO (mode, String, ExitCode))
-&gt; IO (mode, String, ExitCode)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679682170"><span class="annot"><span class="annottext">AsyncM String
</span><a href="#local-6989586621679682170"><span class="hs-identifier hs-var">errA</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">IO mode
-&gt; (AsyncM mode -&gt; IO (mode, String, ExitCode))
-&gt; IO (mode, String, ExitCode)
forall a b. NFData a =&gt; IO a -&gt; (AsyncM a -&gt; IO b) -&gt; IO b
</span><a href="Distribution.Compat.Async.html#withAsyncNF"><span class="hs-identifier hs-var">withAsyncNF</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Handle -&gt; IO mode
forall mode. KnownIODataMode mode =&gt; Handle -&gt; IO mode
</span><a href="Distribution.Utils.IOData.html#hGetIODataContents"><span class="hs-identifier hs-var">IOData.hGetIODataContents</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679682174"><span class="hs-identifier hs-var">outh</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">((AsyncM mode -&gt; IO (mode, String, ExitCode))
 -&gt; IO (mode, String, ExitCode))
-&gt; (AsyncM mode -&gt; IO (mode, String, ExitCode))
-&gt; IO (mode, String, ExitCode)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679682168"><span class="annot"><span class="annottext">AsyncM mode
</span><a href="#local-6989586621679682168"><span class="hs-identifier hs-var">outA</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-883"></span><span>        </span><span class="hs-comment">-- push all the input, if any</span><span>
</span><span id="line-884"></span><span>        </span><span class="annot"><span class="annottext">IO () -&gt; IO ()
</span><a href="#local-6989586621679682167"><span class="hs-identifier hs-var">ignoreSigPipe</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe IOData
</span><a href="#local-6989586621679682205"><span class="hs-identifier hs-var">input</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-885"></span><span>          </span><span class="annot"><span class="annottext">Maybe IOData
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Handle -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.html#hClose"><span class="hs-identifier hs-var">hClose</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679682175"><span class="hs-identifier hs-var">inh</span></a></span><span>
</span><span id="line-886"></span><span>          </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679682166"><span class="annot"><span class="annottext">IOData
</span><a href="#local-6989586621679682166"><span class="hs-identifier hs-var">inputData</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Handle -&gt; IOData -&gt; IO ()
</span><a href="Distribution.Utils.IOData.html#hPutContents"><span class="hs-identifier hs-var">IOData.hPutContents</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679682175"><span class="hs-identifier hs-var">inh</span></a></span><span> </span><span class="annot"><span class="annottext">IOData
</span><a href="#local-6989586621679682166"><span class="hs-identifier hs-var">inputData</span></a></span><span>
</span><span id="line-887"></span><span>
</span><span id="line-888"></span><span>        </span><span class="hs-comment">-- wait for both to finish</span><span>
</span><span id="line-889"></span><span>        </span><span id="local-6989586621679682164"><span class="annot"><span class="annottext">Either SomeException mode
</span><a href="#local-6989586621679682164"><span class="hs-identifier hs-var">mberr1</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">AsyncM mode -&gt; IO (Either SomeException mode)
forall a. AsyncM a -&gt; IO (Either SomeException a)
</span><a href="Distribution.Compat.Async.html#waitCatch"><span class="hs-identifier hs-var">waitCatch</span></a></span><span> </span><span class="annot"><span class="annottext">AsyncM mode
</span><a href="#local-6989586621679682168"><span class="hs-identifier hs-var">outA</span></a></span><span>
</span><span id="line-890"></span><span>        </span><span id="local-6989586621679682162"><span class="annot"><span class="annottext">Either SomeException String
</span><a href="#local-6989586621679682162"><span class="hs-identifier hs-var">mberr2</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">AsyncM String -&gt; IO (Either SomeException String)
forall a. AsyncM a -&gt; IO (Either SomeException a)
</span><a href="Distribution.Compat.Async.html#waitCatch"><span class="hs-identifier hs-var">waitCatch</span></a></span><span> </span><span class="annot"><span class="annottext">AsyncM String
</span><a href="#local-6989586621679682170"><span class="hs-identifier hs-var">errA</span></a></span><span>
</span><span id="line-891"></span><span>
</span><span id="line-892"></span><span>        </span><span class="hs-comment">-- wait for the program to terminate</span><span>
</span><span id="line-893"></span><span>        </span><span id="local-6989586621679682161"><span class="annot"><span class="annottext">ExitCode
</span><a href="#local-6989586621679682161"><span class="hs-identifier hs-var">exitcode</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ProcessHandle -&gt; IO ExitCode
</span><a href="../../process/src/System.Process.html#waitForProcess"><span class="hs-identifier hs-var">waitForProcess</span></a></span><span> </span><span class="annot"><span class="annottext">ProcessHandle
</span><a href="#local-6989586621679682172"><span class="hs-identifier hs-var">pid</span></a></span><span>
</span><span id="line-894"></span><span>
</span><span id="line-895"></span><span>        </span><span class="hs-comment">-- get the stderr, so it can be added to error message</span><span>
</span><span id="line-896"></span><span>        </span><span id="local-6989586621679682160"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682160"><span class="hs-identifier hs-var">err</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Either SomeException String -&gt; IO String
forall a. Either SomeException a -&gt; IO a
</span><a href="#local-6989586621679682159"><span class="hs-identifier hs-var">reportOutputIOError</span></a></span><span> </span><span class="annot"><span class="annottext">Either SomeException String
</span><a href="#local-6989586621679682162"><span class="hs-identifier hs-var">mberr2</span></a></span><span>
</span><span id="line-897"></span><span>
</span><span id="line-898"></span><span>        </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#unless"><span class="hs-identifier hs-var">unless</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ExitCode
</span><a href="#local-6989586621679682161"><span class="hs-identifier hs-var">exitcode</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCode -&gt; ExitCode -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">ExitCode
</span><a href="../../base/src/GHC.IO.Exception.html#ExitSuccess"><span class="hs-identifier hs-var">ExitSuccess</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-899"></span><span>          </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#debug"><span class="hs-identifier hs-var">debug</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682210"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; IO ()) -&gt; String -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682209"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; returned &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCode -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCode
</span><a href="#local-6989586621679682161"><span class="hs-identifier hs-var">exitcode</span></a></span><span>
</span><span id="line-900"></span><span>                         </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">String -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682160"><span class="hs-identifier hs-var">err</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span> </span><span class="hs-keyword">else</span><span>
</span><span id="line-901"></span><span>                            </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; with error message:\n&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682160"><span class="hs-identifier hs-var">err</span></a></span><span>
</span><span id="line-902"></span><span>                         </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe IOData
</span><a href="#local-6989586621679682205"><span class="hs-identifier hs-var">input</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-903"></span><span>                              </span><span class="annot"><span class="annottext">Maybe IOData
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-904"></span><span>                              </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679682157"><span class="annot"><span class="annottext">IOData
</span><a href="#local-6989586621679682157"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">IOData -&gt; Bool
</span><a href="Distribution.Utils.IOData.html#null"><span class="hs-identifier hs-var">IOData.null</span></a></span><span> </span><span class="annot"><span class="annottext">IOData
</span><a href="#local-6989586621679682157"><span class="hs-identifier hs-var">d</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-905"></span><span>                              </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Utils.IOData.html#IODataText"><span class="hs-identifier hs-type">IODataText</span></a></span><span> </span><span id="local-6989586621679682154"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682154"><span class="hs-identifier hs-var">inp</span></a></span></span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;\nstdin input:\n&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682154"><span class="hs-identifier hs-var">inp</span></a></span><span>
</span><span id="line-906"></span><span>                              </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Utils.IOData.html#IODataBinary"><span class="hs-identifier hs-type">IODataBinary</span></a></span><span> </span><span id="local-6989586621679682152"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679682152"><span class="hs-identifier hs-var">inp</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;\nstdin input (binary):\n&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679682152"><span class="hs-identifier hs-var">inp</span></a></span><span>
</span><span id="line-907"></span><span>
</span><span id="line-908"></span><span>        </span><span class="hs-comment">-- Check if we hit an exception while consuming the output</span><span>
</span><span id="line-909"></span><span>        </span><span class="hs-comment">-- (e.g. a text decoding error)</span><span>
</span><span id="line-910"></span><span>        </span><span id="local-6989586621679682151"><span class="annot"><span class="annottext">mode
</span><a href="#local-6989586621679682151"><span class="hs-identifier hs-var">out</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Either SomeException mode -&gt; IO mode
forall a. Either SomeException a -&gt; IO a
</span><a href="#local-6989586621679682159"><span class="hs-identifier hs-var">reportOutputIOError</span></a></span><span> </span><span class="annot"><span class="annottext">Either SomeException mode
</span><a href="#local-6989586621679682164"><span class="hs-identifier hs-var">mberr1</span></a></span><span>
</span><span id="line-911"></span><span>
</span><span id="line-912"></span><span>        </span><span class="annot"><span class="annottext">(mode, String, ExitCode) -&gt; IO (mode, String, ExitCode)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">mode
</span><a href="#local-6989586621679682151"><span class="hs-identifier hs-var">out</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682160"><span class="hs-identifier hs-var">err</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ExitCode
</span><a href="#local-6989586621679682161"><span class="hs-identifier hs-var">exitcode</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-913"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-914"></span><span>    </span><span id="local-6989586621679683107"><span class="annot"><a href="#local-6989586621679682159"><span class="hs-identifier hs-type">reportOutputIOError</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Exception.Type.html#SomeException"><span class="hs-identifier hs-type">Exception.SomeException</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679683107"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621679683107"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-915"></span><span>    </span><span id="local-6989586621679682159"><span class="annot"><span class="annottext">reportOutputIOError :: forall a. Either SomeException a -&gt; IO a
</span><a href="#local-6989586621679682159"><span class="hs-identifier hs-var hs-var">reportOutputIOError</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span id="local-6989586621679682146"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679682146"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; IO a
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679682146"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-916"></span><span>    </span><span class="annot"><a href="#local-6989586621679682159"><span class="hs-identifier hs-var">reportOutputIOError</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span> </span><span id="local-6989586621679682145"><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621679682145"><span class="hs-identifier hs-var">exc</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">SomeException -&gt; Maybe IOException
forall e. Exception e =&gt; SomeException -&gt; Maybe e
</span><a href="../../base/src/GHC.Exception.Type.html#fromException"><span class="hs-identifier hs-var">fromException</span></a></span><span> </span><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621679682145"><span class="hs-identifier hs-var">exc</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-917"></span><span>        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679682143"><span class="annot"><span class="annottext">IOException
</span><a href="#local-6989586621679682143"><span class="hs-identifier hs-var">ioe</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">IOException -&gt; IO a
forall e a. Exception e =&gt; e -&gt; IO a
</span><a href="../../base/src/GHC.IO.html#throwIO"><span class="hs-identifier hs-var">throwIO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IOException -&gt; String -&gt; IOException
</span><a href="../../base/src/System.IO.Error.html#ioeSetFileName"><span class="hs-identifier hs-var">ioeSetFileName</span></a></span><span> </span><span class="annot"><span class="annottext">IOException
</span><a href="#local-6989586621679682143"><span class="hs-identifier hs-var">ioe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;output of &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682209"><span class="hs-identifier hs-var">path</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-918"></span><span>        </span><span class="annot"><span class="annottext">Maybe IOException
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">SomeException -&gt; IO a
forall e a. Exception e =&gt; e -&gt; IO a
</span><a href="../../base/src/GHC.IO.html#throwIO"><span class="hs-identifier hs-var">throwIO</span></a></span><span> </span><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621679682145"><span class="hs-identifier hs-var">exc</span></a></span><span>
</span><span id="line-919"></span><span>
</span><span id="line-920"></span><span>    </span><span class="annot"><a href="#local-6989586621679682167"><span class="hs-identifier hs-type">ignoreSigPipe</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-921"></span><span>    </span><span id="local-6989586621679682167"><span class="annot"><span class="annottext">ignoreSigPipe :: IO () -&gt; IO ()
</span><a href="#local-6989586621679682167"><span class="hs-identifier hs-var hs-var">ignoreSigPipe</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(IOException -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall e a. Exception e =&gt; (e -&gt; IO a) -&gt; IO a -&gt; IO a
</span><a href="../../base/src/Control.Exception.Base.html#handle"><span class="hs-identifier hs-var">Exception.handle</span></a></span><span> </span><span class="annot"><span class="annottext">((IOException -&gt; IO ()) -&gt; IO () -&gt; IO ())
-&gt; (IOException -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679682140"><span class="annot"><span class="annottext">IOException
</span><a href="#local-6989586621679682140"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">IOException
</span><a href="#local-6989586621679682140"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-922"></span><span>        </span><span class="annot"><a href="../../base/src/GHC.IO.Exception.html#IOError"><span class="hs-identifier hs-type">GHC.IOError</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">ioe_type :: IOException -&gt; IOErrorType
</span><a href="../../base/src/GHC.IO.Exception.html#ioe_type"><span class="hs-identifier hs-var">GHC.ioe_type</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IOErrorType
</span><a href="../../base/src/GHC.IO.Exception.html#ResourceVanished"><span class="hs-identifier hs-var">GHC.ResourceVanished</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ioe_errno :: IOException -&gt; Maybe CInt
</span><a href="../../base/src/GHC.IO.Exception.html#ioe_errno"><span class="hs-identifier hs-var">GHC.ioe_errno</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679682135"><span class="annot"><span class="annottext">CInt
</span><a href="#local-6989586621679682135"><span class="hs-identifier hs-var">ioe</span></a></span></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-923"></span><span>            </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">CInt -&gt; Errno
</span><a href="../../base/src/Foreign.C.Error.html#Errno"><span class="hs-identifier hs-var">Errno</span></a></span><span> </span><span class="annot"><span class="annottext">CInt
</span><a href="#local-6989586621679682135"><span class="hs-identifier hs-var">ioe</span></a></span><span> </span><span class="annot"><span class="annottext">Errno -&gt; Errno -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Errno
</span><a href="../../base/src/Foreign.C.Error.html#ePIPE"><span class="hs-identifier hs-var">ePIPE</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-924"></span><span>        </span><span class="annot"><span class="annottext">IOException
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">IOException -&gt; IO ()
forall e a. Exception e =&gt; e -&gt; IO a
</span><a href="../../base/src/GHC.IO.html#throwIO"><span class="hs-identifier hs-var">throwIO</span></a></span><span> </span><span class="annot"><span class="annottext">IOException
</span><a href="#local-6989586621679682140"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-925"></span><span>
</span><span id="line-926"></span><span class="hs-comment">-- | Look for a program and try to find it's version number. It can accept</span><span>
</span><span id="line-927"></span><span class="hs-comment">-- either an absolute path or the name of a program binary, in which case we</span><span>
</span><span id="line-928"></span><span class="hs-comment">-- will look for the program on the path.</span><span>
</span><span id="line-929"></span><span class="hs-comment">--</span><span>
</span><span id="line-930"></span><span class="annot"><a href="Distribution.Simple.Utils.html#findProgramVersion"><span class="hs-identifier hs-type">findProgramVersion</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>             </span><span class="hs-comment">-- ^ version args</span><span>
</span><span id="line-931"></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- ^ function to select version</span><span>
</span><span id="line-932"></span><span>                                         </span><span class="hs-comment">--   number from program output</span><span>
</span><span id="line-933"></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span>
</span><span id="line-934"></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>           </span><span class="hs-comment">-- ^ location</span><span>
</span><span id="line-935"></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.Version.html#Version"><span class="hs-identifier hs-type">Version</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-936"></span><span id="findProgramVersion"><span class="annot"><span class="annottext">findProgramVersion :: String
-&gt; (String -&gt; String) -&gt; Verbosity -&gt; String -&gt; IO (Maybe Version)
</span><a href="Distribution.Simple.Utils.html#findProgramVersion"><span class="hs-identifier hs-var hs-var">findProgramVersion</span></a></span></span><span> </span><span id="local-6989586621679682133"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682133"><span class="hs-identifier hs-var">versionArg</span></a></span></span><span> </span><span id="local-6989586621679682132"><span class="annot"><span class="annottext">String -&gt; String
</span><a href="#local-6989586621679682132"><span class="hs-identifier hs-var">selectVersion</span></a></span></span><span> </span><span id="local-6989586621679682131"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682131"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679682130"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682130"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HasCallStack =&gt; IO (Maybe Version)) -&gt; IO (Maybe Version)
forall a. HasCallStack =&gt; (HasCallStack =&gt; a) -&gt; a
</span><a href="../../base/src/GHC.Stack.html#withFrozenCallStack"><span class="hs-identifier hs-var">withFrozenCallStack</span></a></span><span> </span><span class="annot"><span class="annottext">((HasCallStack =&gt; IO (Maybe Version)) -&gt; IO (Maybe Version))
-&gt; (HasCallStack =&gt; IO (Maybe Version)) -&gt; IO (Maybe Version)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-937"></span><span>  </span><span id="local-6989586621679682115"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682115"><span class="hs-identifier hs-var">str</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; [String] -&gt; IO String
forall mode.
KnownIODataMode mode =&gt;
Verbosity -&gt; String -&gt; [String] -&gt; IO mode
</span><a href="Distribution.Simple.Utils.html#rawSystemStdout"><span class="hs-identifier hs-var">rawSystemStdout</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682131"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682130"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682133"><span class="hs-identifier hs-var">versionArg</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-938"></span><span>         </span><span class="annot"><span class="annottext">IO String -&gt; (IOException -&gt; IO String) -&gt; IO String
forall a. IO a -&gt; (IOException -&gt; IO a) -&gt; IO a
</span><a href="Distribution.Compat.Exception.html#catchIO"><span class="hs-operator hs-var">`catchIO`</span></a></span><span>   </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">IOException
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO String
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-939"></span><span>         </span><span class="annot"><span class="annottext">IO String -&gt; (ExitCode -&gt; IO String) -&gt; IO String
forall a. IO a -&gt; (ExitCode -&gt; IO a) -&gt; IO a
</span><a href="Distribution.Compat.Exception.html#catchExit"><span class="hs-operator hs-var">`catchExit`</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">ExitCode
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO String
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-940"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span class="annot"><a href="#local-6989586621679682113"><span class="hs-identifier hs-type">version</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.Version.html#Version"><span class="hs-identifier hs-type">Version</span></a></span><span>
</span><span id="line-941"></span><span>      </span><span id="local-6989586621679682113"><span class="annot"><span class="annottext">version :: Maybe Version
</span><a href="#local-6989586621679682113"><span class="hs-identifier hs-var hs-var">version</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Maybe Version
forall a. Parsec a =&gt; String -&gt; Maybe a
</span><a href="Distribution.Parsec.html#simpleParsec"><span class="hs-identifier hs-var">simpleParsec</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="#local-6989586621679682132"><span class="hs-identifier hs-var">selectVersion</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682115"><span class="hs-identifier hs-var">str</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-942"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe Version
</span><a href="#local-6989586621679682113"><span class="hs-identifier hs-var">version</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-943"></span><span>      </span><span class="annot"><span class="annottext">Maybe Version
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#warn"><span class="hs-identifier hs-var">warn</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682131"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; IO ()) -&gt; String -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;cannot determine version of &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682130"><span class="hs-identifier hs-var">path</span></a></span><span>
</span><span id="line-944"></span><span>                               </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; :\n&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682115"><span class="hs-identifier hs-var">str</span></a></span><span>
</span><span id="line-945"></span><span>      </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679682111"><span class="annot"><span class="annottext">Version
</span><a href="#local-6989586621679682111"><span class="hs-identifier hs-var">v</span></a></span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#debug"><span class="hs-identifier hs-var">debug</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682131"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; IO ()) -&gt; String -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682130"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; is version &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">Version -&gt; String
forall a. Pretty a =&gt; a -&gt; String
</span><a href="Distribution.Pretty.html#prettyShow"><span class="hs-identifier hs-var">prettyShow</span></a></span><span> </span><span class="annot"><span class="annottext">Version
</span><a href="#local-6989586621679682111"><span class="hs-identifier hs-var">v</span></a></span><span>
</span><span id="line-946"></span><span>  </span><span class="annot"><span class="annottext">Maybe Version -&gt; IO (Maybe Version)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Version
</span><a href="#local-6989586621679682113"><span class="hs-identifier hs-var">version</span></a></span><span>
</span><span id="line-947"></span><span>
</span><span id="line-948"></span><span>
</span><span id="line-949"></span><span class="hs-comment">-- | Like the Unix xargs program. Useful for when we've got very long command</span><span>
</span><span id="line-950"></span><span class="hs-comment">-- lines that might overflow an OS limit on command line length and so you</span><span>
</span><span id="line-951"></span><span class="hs-comment">-- need to invoke a command multiple times to get all the args in.</span><span>
</span><span id="line-952"></span><span class="hs-comment">--</span><span>
</span><span id="line-953"></span><span class="hs-comment">-- Use it with either of the rawSystem variants above. For example:</span><span>
</span><span id="line-954"></span><span class="hs-comment">--</span><span>
</span><span id="line-955"></span><span class="hs-comment">-- &gt; xargs (32*1024) (rawSystemExit verbosity) prog fixedArgs bigArgs</span><span>
</span><span id="line-956"></span><span class="hs-comment">--</span><span>
</span><span id="line-957"></span><span class="annot"><a href="Distribution.Simple.Utils.html#xargs"><span class="hs-identifier hs-type">xargs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-958"></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-959"></span><span id="xargs"><span class="annot"><span class="annottext">xargs :: Int -&gt; ([String] -&gt; IO ()) -&gt; [String] -&gt; [String] -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#xargs"><span class="hs-identifier hs-var hs-var">xargs</span></a></span></span><span> </span><span id="local-6989586621679682110"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679682110"><span class="hs-identifier hs-var">maxSize</span></a></span></span><span> </span><span id="local-6989586621679682109"><span class="annot"><span class="annottext">[String] -&gt; IO ()
</span><a href="#local-6989586621679682109"><span class="hs-identifier hs-var">rawSystemFun</span></a></span></span><span> </span><span id="local-6989586621679682108"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682108"><span class="hs-identifier hs-var">fixedArgs</span></a></span></span><span> </span><span id="local-6989586621679682107"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682107"><span class="hs-identifier hs-var">bigArgs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-960"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679682106"><span class="annot"><span class="annottext">fixedArgSize :: Int
</span><a href="#local-6989586621679682106"><span class="hs-identifier hs-var hs-var">fixedArgSize</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Int] -&gt; Int
forall (t :: * -&gt; *) a. (Foldable t, Num a) =&gt; t a -&gt; a
</span><a href="../../base/src/Data.Foldable.html#sum"><span class="hs-identifier hs-var">sum</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(String -&gt; Int) -&gt; [String] -&gt; [Int]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682108"><span class="hs-identifier hs-var">fixedArgs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">[String] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682108"><span class="hs-identifier hs-var">fixedArgs</span></a></span><span>
</span><span id="line-961"></span><span>      </span><span id="local-6989586621679682103"><span class="annot"><span class="annottext">chunkSize :: Int
</span><a href="#local-6989586621679682103"><span class="hs-identifier hs-var hs-var">chunkSize</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679682110"><span class="hs-identifier hs-var">maxSize</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679682106"><span class="hs-identifier hs-var">fixedArgSize</span></a></span><span>
</span><span id="line-962"></span><span>   </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">([String] -&gt; IO ()) -&gt; [[String]] -&gt; IO ()
forall (t :: * -&gt; *) (f :: * -&gt; *) a b.
(Foldable t, Applicative f) =&gt;
(a -&gt; f b) -&gt; t a -&gt; f ()
</span><a href="../../base/src/Data.Foldable.html#traverse_"><span class="hs-identifier hs-var">traverse_</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[String] -&gt; IO ()
</span><a href="#local-6989586621679682109"><span class="hs-identifier hs-var">rawSystemFun</span></a></span><span> </span><span class="annot"><span class="annottext">([String] -&gt; IO ()) -&gt; ([String] -&gt; [String]) -&gt; [String] -&gt; IO ()
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682108"><span class="hs-identifier hs-var">fixedArgs</span></a></span><span> </span><span class="annot"><span class="annottext">[String] -&gt; [String] -&gt; [String]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; [String] -&gt; [[String]]
forall {t :: * -&gt; *} {a}. Foldable t =&gt; Int -&gt; [t a] -&gt; [[t a]]
</span><a href="#local-6989586621679682101"><span class="hs-identifier hs-var">chunks</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679682103"><span class="hs-identifier hs-var">chunkSize</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682107"><span class="hs-identifier hs-var">bigArgs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-963"></span><span>
</span><span id="line-964"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679682101"><span class="annot"><span class="annottext">chunks :: Int -&gt; [t a] -&gt; [[t a]]
</span><a href="#local-6989586621679682101"><span class="hs-identifier hs-var hs-var">chunks</span></a></span></span><span> </span><span id="local-6989586621679682097"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679682097"><span class="hs-identifier hs-var">len</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([t a] -&gt; Maybe ([t a], [t a])) -&gt; [t a] -&gt; [[t a]]
forall b a. (b -&gt; Maybe (a, b)) -&gt; b -&gt; [a]
</span><a href="../../base/src/Data.OldList.html#unfoldr"><span class="hs-identifier hs-var">unfoldr</span></a></span><span> </span><span class="annot"><span class="annottext">(([t a] -&gt; Maybe ([t a], [t a])) -&gt; [t a] -&gt; [[t a]])
-&gt; ([t a] -&gt; Maybe ([t a], [t a])) -&gt; [t a] -&gt; [[t a]]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679682095"><span class="annot"><span class="annottext">[t a]
</span><a href="#local-6989586621679682095"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-965"></span><span>          </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">[t a] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[t a]
</span><a href="#local-6989586621679682095"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Maybe ([t a], [t a])
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-966"></span><span>                    </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">([t a], [t a]) -&gt; Maybe ([t a], [t a])
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[t a] -&gt; Int -&gt; [t a] -&gt; ([t a], [t a])
forall {t :: * -&gt; *} {a}.
Foldable t =&gt;
[t a] -&gt; Int -&gt; [t a] -&gt; ([t a], [t a])
</span><a href="#local-6989586621679682094"><span class="hs-identifier hs-var">chunk</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679682097"><span class="hs-identifier hs-var">len</span></a></span><span> </span><span class="annot"><span class="annottext">[t a]
</span><a href="#local-6989586621679682095"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-967"></span><span>
</span><span id="line-968"></span><span>        </span><span id="local-6989586621679682094"><span class="annot"><span class="annottext">chunk :: [t a] -&gt; Int -&gt; [t a] -&gt; ([t a], [t a])
</span><a href="#local-6989586621679682094"><span class="hs-identifier hs-var hs-var">chunk</span></a></span></span><span> </span><span id="local-6989586621679682086"><span class="annot"><span class="annottext">[t a]
</span><a href="#local-6989586621679682086"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span>   </span><span class="hs-special">[</span><span class="hs-special">]</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[t a] -&gt; [t a]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">[t a]
</span><a href="#local-6989586621679682086"><span class="hs-identifier hs-var">acc</span></a></span><span class="hs-special">,</span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-969"></span><span>        </span><span class="annot"><a href="#local-6989586621679682094"><span class="hs-identifier hs-var">chunk</span></a></span><span> </span><span id="local-6989586621679682084"><span class="annot"><span class="annottext">[t a]
</span><a href="#local-6989586621679682084"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span id="local-6989586621679682083"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679682083"><span class="hs-identifier hs-var">len</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679682082"><span class="annot"><span class="annottext">t a
</span><a href="#local-6989586621679682082"><span class="hs-identifier hs-var">s</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679682081"><span class="annot"><span class="annottext">[t a]
</span><a href="#local-6989586621679682081"><span class="hs-identifier hs-var">ss</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-970"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679682080"><span class="hs-identifier hs-var">len'</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679682083"><span class="hs-identifier hs-var">len</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[t a] -&gt; Int -&gt; [t a] -&gt; ([t a], [t a])
</span><a href="#local-6989586621679682094"><span class="hs-identifier hs-var">chunk</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">t a
</span><a href="#local-6989586621679682082"><span class="hs-identifier hs-var">s</span></a></span><span class="annot"><span class="annottext">t a -&gt; [t a] -&gt; [t a]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[t a]
</span><a href="#local-6989586621679682084"><span class="hs-identifier hs-var">acc</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679682083"><span class="hs-identifier hs-var">len</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679682080"><span class="hs-identifier hs-var">len'</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[t a]
</span><a href="#local-6989586621679682081"><span class="hs-identifier hs-var">ss</span></a></span><span>
</span><span id="line-971"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[t a] -&gt; [t a]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">[t a]
</span><a href="#local-6989586621679682084"><span class="hs-identifier hs-var">acc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">t a
</span><a href="#local-6989586621679682082"><span class="hs-identifier hs-var">s</span></a></span><span class="annot"><span class="annottext">t a -&gt; [t a] -&gt; [t a]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[t a]
</span><a href="#local-6989586621679682081"><span class="hs-identifier hs-var">ss</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-972"></span><span>          </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679682080"><span class="annot"><span class="annottext">len' :: Int
</span><a href="#local-6989586621679682080"><span class="hs-identifier hs-var hs-var">len'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">t a -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">t a
</span><a href="#local-6989586621679682082"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-973"></span><span>
</span><span id="line-974"></span><span class="hs-comment">-- ------------------------------------------------------------</span><span>
</span><span id="line-975"></span><span class="hs-comment">-- * File Utilities</span><span>
</span><span id="line-976"></span><span class="hs-comment">-- ------------------------------------------------------------</span><span>
</span><span id="line-977"></span><span>
</span><span id="line-978"></span><span class="hs-comment">----------------</span><span>
</span><span id="line-979"></span><span class="hs-comment">-- Finding files</span><span>
</span><span id="line-980"></span><span>
</span><span id="line-981"></span><span>
</span><span id="line-982"></span><span class="hs-pragma">{-# DEPRECATED</span><span> </span><span class="hs-pragma">findFile</span><span> </span><span class="hs-pragma">&quot;Use findFileEx instead. This symbol will be removed in Cabal 3.2 (est. December 2019)&quot;</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-983"></span><span class="annot"><a href="Distribution.Simple.Utils.html#findFile"><span class="hs-identifier hs-type">findFile</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">]</span><span>    </span><span class="hs-comment">-- ^search locations</span><span>
</span><span id="line-984"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>      </span><span class="hs-comment">-- ^File Name</span><span>
</span><span id="line-985"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-986"></span><span id="findFile"><span class="annot"><span class="annottext">findFile :: [String] -&gt; String -&gt; IO String
</span><a href="Distribution.Simple.Utils.html#findFile"><span class="hs-identifier hs-var hs-var">findFile</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; [String] -&gt; String -&gt; IO String
</span><a href="Distribution.Simple.Utils.html#findFileEx"><span class="hs-identifier hs-var">findFileEx</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="Distribution.Verbosity.html#normal"><span class="hs-identifier hs-var">normal</span></a></span><span>
</span><span id="line-987"></span><span>
</span><span id="line-988"></span><span class="hs-comment">-- | Find a file by looking in a search path. The file path must match exactly.</span><span>
</span><span id="line-989"></span><span class="hs-comment">--</span><span>
</span><span id="line-990"></span><span class="hs-comment">-- @since 3.4.0.0</span><span>
</span><span id="line-991"></span><span class="annot"><a href="Distribution.Simple.Utils.html#findFileCwd"><span class="hs-identifier hs-type">findFileCwd</span></a></span><span>
</span><span id="line-992"></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span>
</span><span id="line-993"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>      </span><span class="hs-comment">-- ^ cwd</span><span>
</span><span id="line-994"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">]</span><span>    </span><span class="hs-comment">-- ^ relative search location</span><span>
</span><span id="line-995"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>      </span><span class="hs-comment">-- ^ File Name</span><span>
</span><span id="line-996"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-997"></span><span id="findFileCwd"><span class="annot"><span class="annottext">findFileCwd :: Verbosity -&gt; String -&gt; [String] -&gt; String -&gt; IO String
</span><a href="Distribution.Simple.Utils.html#findFileCwd"><span class="hs-identifier hs-var hs-var">findFileCwd</span></a></span></span><span> </span><span id="local-6989586621679682078"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682078"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679682077"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682077"><span class="hs-identifier hs-var">cwd</span></a></span></span><span> </span><span id="local-6989586621679682076"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682076"><span class="hs-identifier hs-var">searchPath</span></a></span></span><span> </span><span id="local-6989586621679682075"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682075"><span class="hs-identifier hs-var">fileName</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-998"></span><span>  </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; [String] -&gt; IO (Maybe String)
forall a. (a -&gt; String) -&gt; [a] -&gt; IO (Maybe a)
</span><a href="Distribution.Simple.Utils.html#findFirstFile"><span class="hs-identifier hs-var">findFirstFile</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682077"><span class="hs-identifier hs-var">cwd</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-999"></span><span>    </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682074"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682075"><span class="hs-identifier hs-var">fileName</span></a></span><span>
</span><span id="line-1000"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621679682074"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682074"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; [String]
forall a. Eq a =&gt; [a] -&gt; [a]
</span><a href="../../base/src/Data.OldList.html#nub"><span class="hs-identifier hs-var">nub</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682076"><span class="hs-identifier hs-var">searchPath</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1001"></span><span>  </span><span class="annot"><span class="annottext">IO (Maybe String) -&gt; (Maybe String -&gt; IO String) -&gt; IO String
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">IO String -&gt; (String -&gt; IO String) -&gt; Maybe String -&gt; IO String
forall b a. b -&gt; (a -&gt; b) -&gt; Maybe a -&gt; b
</span><a href="../../base/src/Data.Maybe.html#maybe"><span class="hs-identifier hs-var">maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; IO String
forall a. Verbosity -&gt; String -&gt; IO a
</span><a href="Distribution.Simple.Utils.html#die%27"><span class="hs-identifier hs-var">die'</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682078"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; IO String) -&gt; String -&gt; IO String
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682075"><span class="hs-identifier hs-var">fileName</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; doesn't exist&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO String
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span>
</span><span id="line-1002"></span><span>
</span><span id="line-1003"></span><span class="hs-comment">-- | Find a file by looking in a search path. The file path must match exactly.</span><span>
</span><span id="line-1004"></span><span class="hs-comment">--</span><span>
</span><span id="line-1005"></span><span class="annot"><a href="Distribution.Simple.Utils.html#findFileEx"><span class="hs-identifier hs-type">findFileEx</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span>
</span><span id="line-1006"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">]</span><span>    </span><span class="hs-comment">-- ^search locations</span><span>
</span><span id="line-1007"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>      </span><span class="hs-comment">-- ^File Name</span><span>
</span><span id="line-1008"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-1009"></span><span id="findFileEx"><span class="annot"><span class="annottext">findFileEx :: Verbosity -&gt; [String] -&gt; String -&gt; IO String
</span><a href="Distribution.Simple.Utils.html#findFileEx"><span class="hs-identifier hs-var hs-var">findFileEx</span></a></span></span><span> </span><span id="local-6989586621679682072"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682072"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679682071"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682071"><span class="hs-identifier hs-var">searchPath</span></a></span></span><span> </span><span id="local-6989586621679682070"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682070"><span class="hs-identifier hs-var">fileName</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1010"></span><span>  </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; [String] -&gt; IO (Maybe String)
forall a. (a -&gt; String) -&gt; [a] -&gt; IO (Maybe a)
</span><a href="Distribution.Simple.Utils.html#findFirstFile"><span class="hs-identifier hs-var">findFirstFile</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-1011"></span><span>    </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682069"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682070"><span class="hs-identifier hs-var">fileName</span></a></span><span>
</span><span id="line-1012"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621679682069"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682069"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; [String]
forall a. Eq a =&gt; [a] -&gt; [a]
</span><a href="../../base/src/Data.OldList.html#nub"><span class="hs-identifier hs-var">nub</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682071"><span class="hs-identifier hs-var">searchPath</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1013"></span><span>  </span><span class="annot"><span class="annottext">IO (Maybe String) -&gt; (Maybe String -&gt; IO String) -&gt; IO String
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">IO String -&gt; (String -&gt; IO String) -&gt; Maybe String -&gt; IO String
forall b a. b -&gt; (a -&gt; b) -&gt; Maybe a -&gt; b
</span><a href="../../base/src/Data.Maybe.html#maybe"><span class="hs-identifier hs-var">maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; IO String
forall a. Verbosity -&gt; String -&gt; IO a
</span><a href="Distribution.Simple.Utils.html#die%27"><span class="hs-identifier hs-var">die'</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682072"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; IO String) -&gt; String -&gt; IO String
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682070"><span class="hs-identifier hs-var">fileName</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; doesn't exist&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO String
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span>
</span><span id="line-1014"></span><span>
</span><span id="line-1015"></span><span class="hs-comment">-- | Find a file by looking in a search path with one of a list of possible</span><span>
</span><span id="line-1016"></span><span class="hs-comment">-- file extensions. The file base name should be given and it will be tried</span><span>
</span><span id="line-1017"></span><span class="hs-comment">-- with each of the extensions in each element of the search path.</span><span>
</span><span id="line-1018"></span><span class="hs-comment">--</span><span>
</span><span id="line-1019"></span><span class="annot"><a href="Distribution.Simple.Utils.html#findFileWithExtension"><span class="hs-identifier hs-type">findFileWithExtension</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1020"></span><span>                      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1021"></span><span>                      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-1022"></span><span>                      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1023"></span><span id="findFileWithExtension"><span class="annot"><span class="annottext">findFileWithExtension :: [String] -&gt; [String] -&gt; String -&gt; IO (Maybe String)
</span><a href="Distribution.Simple.Utils.html#findFileWithExtension"><span class="hs-identifier hs-var hs-var">findFileWithExtension</span></a></span></span><span> </span><span id="local-6989586621679682068"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682068"><span class="hs-identifier hs-var">extensions</span></a></span></span><span> </span><span id="local-6989586621679682067"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682067"><span class="hs-identifier hs-var">searchPath</span></a></span></span><span> </span><span id="local-6989586621679682066"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682066"><span class="hs-identifier hs-var">baseName</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1024"></span><span>  </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; [String] -&gt; IO (Maybe String)
forall a. (a -&gt; String) -&gt; [a] -&gt; IO (Maybe a)
</span><a href="Distribution.Simple.Utils.html#findFirstFile"><span class="hs-identifier hs-var">findFirstFile</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-1025"></span><span>    </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682065"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682066"><span class="hs-identifier hs-var">baseName</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C.%3E"><span class="hs-operator hs-var">&lt;.&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682064"><span class="hs-identifier hs-var">ext</span></a></span><span>
</span><span id="line-1026"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621679682065"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682065"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; [String]
forall a. Eq a =&gt; [a] -&gt; [a]
</span><a href="../../base/src/Data.OldList.html#nub"><span class="hs-identifier hs-var">nub</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682067"><span class="hs-identifier hs-var">searchPath</span></a></span><span>
</span><span id="line-1027"></span><span>    </span><span class="hs-special">,</span><span> </span><span id="local-6989586621679682064"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682064"><span class="hs-identifier hs-var">ext</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; [String]
forall a. Eq a =&gt; [a] -&gt; [a]
</span><a href="../../base/src/Data.OldList.html#nub"><span class="hs-identifier hs-var">nub</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682068"><span class="hs-identifier hs-var">extensions</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-1028"></span><span>
</span><span id="line-1029"></span><span class="hs-comment">-- | @since 3.4.0.0</span><span>
</span><span id="line-1030"></span><span class="annot"><a href="Distribution.Simple.Utils.html#findFileCwdWithExtension"><span class="hs-identifier hs-type">findFileCwdWithExtension</span></a></span><span>
</span><span id="line-1031"></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-1032"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1033"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1034"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-1035"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1036"></span><span id="findFileCwdWithExtension"><span class="annot"><span class="annottext">findFileCwdWithExtension :: String -&gt; [String] -&gt; [String] -&gt; String -&gt; IO (Maybe String)
</span><a href="Distribution.Simple.Utils.html#findFileCwdWithExtension"><span class="hs-identifier hs-var hs-var">findFileCwdWithExtension</span></a></span></span><span> </span><span id="local-6989586621679682063"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682063"><span class="hs-identifier hs-var">cwd</span></a></span></span><span> </span><span id="local-6989586621679682062"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682062"><span class="hs-identifier hs-var">extensions</span></a></span></span><span> </span><span id="local-6989586621679682061"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682061"><span class="hs-identifier hs-var">searchPath</span></a></span></span><span> </span><span id="local-6989586621679682060"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682060"><span class="hs-identifier hs-var">baseName</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1037"></span><span>  </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; [String] -&gt; IO (Maybe String)
forall a. (a -&gt; String) -&gt; [a] -&gt; IO (Maybe a)
</span><a href="Distribution.Simple.Utils.html#findFirstFile"><span class="hs-identifier hs-var">findFirstFile</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682063"><span class="hs-identifier hs-var">cwd</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1038"></span><span>    </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682059"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682060"><span class="hs-identifier hs-var">baseName</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C.%3E"><span class="hs-operator hs-var">&lt;.&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682058"><span class="hs-identifier hs-var">ext</span></a></span><span>
</span><span id="line-1039"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621679682059"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682059"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; [String]
forall a. Eq a =&gt; [a] -&gt; [a]
</span><a href="../../base/src/Data.OldList.html#nub"><span class="hs-identifier hs-var">nub</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682061"><span class="hs-identifier hs-var">searchPath</span></a></span><span>
</span><span id="line-1040"></span><span>    </span><span class="hs-special">,</span><span> </span><span id="local-6989586621679682058"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682058"><span class="hs-identifier hs-var">ext</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; [String]
forall a. Eq a =&gt; [a] -&gt; [a]
</span><a href="../../base/src/Data.OldList.html#nub"><span class="hs-identifier hs-var">nub</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682062"><span class="hs-identifier hs-var">extensions</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-1041"></span><span>
</span><span id="line-1042"></span><span class="hs-comment">-- | @since 3.4.0.0</span><span>
</span><span id="line-1043"></span><span class="annot"><a href="Distribution.Simple.Utils.html#findAllFilesCwdWithExtension"><span class="hs-identifier hs-type">findAllFilesCwdWithExtension</span></a></span><span>
</span><span id="line-1044"></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>       </span><span class="hs-comment">-- ^ cwd</span><span>
</span><span id="line-1045"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span>       </span><span class="hs-comment">-- ^ extensions</span><span>
</span><span id="line-1046"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">]</span><span>     </span><span class="hs-comment">-- ^ relative search locations</span><span>
</span><span id="line-1047"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>       </span><span class="hs-comment">-- ^ basename</span><span>
</span><span id="line-1048"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1049"></span><span id="findAllFilesCwdWithExtension"><span class="annot"><span class="annottext">findAllFilesCwdWithExtension :: String -&gt; [String] -&gt; [String] -&gt; String -&gt; IO [String]
</span><a href="Distribution.Simple.Utils.html#findAllFilesCwdWithExtension"><span class="hs-identifier hs-var hs-var">findAllFilesCwdWithExtension</span></a></span></span><span> </span><span id="local-6989586621679682057"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682057"><span class="hs-identifier hs-var">cwd</span></a></span></span><span> </span><span id="local-6989586621679682056"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682056"><span class="hs-identifier hs-var">extensions</span></a></span></span><span> </span><span id="local-6989586621679682055"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682055"><span class="hs-identifier hs-var">searchPath</span></a></span></span><span> </span><span id="local-6989586621679682054"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682054"><span class="hs-identifier hs-var">basename</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1050"></span><span>  </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; [String] -&gt; IO [String]
forall a. (a -&gt; String) -&gt; [a] -&gt; IO [a]
</span><a href="Distribution.Simple.Utils.html#findAllFiles"><span class="hs-identifier hs-var">findAllFiles</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682057"><span class="hs-identifier hs-var">cwd</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1051"></span><span>    </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682052"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682054"><span class="hs-identifier hs-var">basename</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C.%3E"><span class="hs-operator hs-var">&lt;.&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682051"><span class="hs-identifier hs-var">ext</span></a></span><span>
</span><span id="line-1052"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621679682052"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682052"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; [String]
forall a. Eq a =&gt; [a] -&gt; [a]
</span><a href="../../base/src/Data.OldList.html#nub"><span class="hs-identifier hs-var">nub</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682055"><span class="hs-identifier hs-var">searchPath</span></a></span><span>
</span><span id="line-1053"></span><span>    </span><span class="hs-special">,</span><span> </span><span id="local-6989586621679682051"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682051"><span class="hs-identifier hs-var">ext</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; [String]
forall a. Eq a =&gt; [a] -&gt; [a]
</span><a href="../../base/src/Data.OldList.html#nub"><span class="hs-identifier hs-var">nub</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682056"><span class="hs-identifier hs-var">extensions</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-1054"></span><span>
</span><span id="line-1055"></span><span class="annot"><a href="Distribution.Simple.Utils.html#findAllFilesWithExtension"><span class="hs-identifier hs-type">findAllFilesWithExtension</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1056"></span><span>                          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1057"></span><span>                          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-1058"></span><span>                          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1059"></span><span id="findAllFilesWithExtension"><span class="annot"><span class="annottext">findAllFilesWithExtension :: [String] -&gt; [String] -&gt; String -&gt; IO [String]
</span><a href="Distribution.Simple.Utils.html#findAllFilesWithExtension"><span class="hs-identifier hs-var hs-var">findAllFilesWithExtension</span></a></span></span><span> </span><span id="local-6989586621679682050"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682050"><span class="hs-identifier hs-var">extensions</span></a></span></span><span> </span><span id="local-6989586621679682049"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682049"><span class="hs-identifier hs-var">searchPath</span></a></span></span><span> </span><span id="local-6989586621679682048"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682048"><span class="hs-identifier hs-var">basename</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1060"></span><span>  </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; [String] -&gt; IO [String]
forall a. (a -&gt; String) -&gt; [a] -&gt; IO [a]
</span><a href="Distribution.Simple.Utils.html#findAllFiles"><span class="hs-identifier hs-var">findAllFiles</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-1061"></span><span>    </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682047"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682048"><span class="hs-identifier hs-var">basename</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C.%3E"><span class="hs-operator hs-var">&lt;.&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682046"><span class="hs-identifier hs-var">ext</span></a></span><span>
</span><span id="line-1062"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621679682047"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682047"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; [String]
forall a. Eq a =&gt; [a] -&gt; [a]
</span><a href="../../base/src/Data.OldList.html#nub"><span class="hs-identifier hs-var">nub</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682049"><span class="hs-identifier hs-var">searchPath</span></a></span><span>
</span><span id="line-1063"></span><span>    </span><span class="hs-special">,</span><span> </span><span id="local-6989586621679682046"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682046"><span class="hs-identifier hs-var">ext</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; [String]
forall a. Eq a =&gt; [a] -&gt; [a]
</span><a href="../../base/src/Data.OldList.html#nub"><span class="hs-identifier hs-var">nub</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682050"><span class="hs-identifier hs-var">extensions</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-1064"></span><span>
</span><span id="line-1065"></span><span class="hs-comment">-- | Like 'findFileWithExtension' but returns which element of the search path</span><span>
</span><span id="line-1066"></span><span class="hs-comment">-- the file was found in, and the file path relative to that base directory.</span><span>
</span><span id="line-1067"></span><span class="hs-comment">--</span><span>
</span><span id="line-1068"></span><span class="annot"><a href="Distribution.Simple.Utils.html#findFileWithExtension%27"><span class="hs-identifier hs-type">findFileWithExtension'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1069"></span><span>                       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1070"></span><span>                       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-1071"></span><span>                       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1072"></span><span id="findFileWithExtension%27"><span class="annot"><span class="annottext">findFileWithExtension' :: [String] -&gt; [String] -&gt; String -&gt; IO (Maybe (String, String))
</span><a href="Distribution.Simple.Utils.html#findFileWithExtension%27"><span class="hs-identifier hs-var hs-var">findFileWithExtension'</span></a></span></span><span> </span><span id="local-6989586621679682045"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682045"><span class="hs-identifier hs-var">extensions</span></a></span></span><span> </span><span id="local-6989586621679682044"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682044"><span class="hs-identifier hs-var">searchPath</span></a></span></span><span> </span><span id="local-6989586621679682043"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682043"><span class="hs-identifier hs-var">baseName</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1073"></span><span>  </span><span class="annot"><span class="annottext">((String, String) -&gt; String)
-&gt; [(String, String)] -&gt; IO (Maybe (String, String))
forall a. (a -&gt; String) -&gt; [a] -&gt; IO (Maybe a)
</span><a href="Distribution.Simple.Utils.html#findFirstFile"><span class="hs-identifier hs-var">findFirstFile</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(String -&gt; String -&gt; String) -&gt; (String, String) -&gt; String
forall a b c. (a -&gt; b -&gt; c) -&gt; (a, b) -&gt; c
</span><a href="../../base/src/Data.Tuple.html#uncurry"><span class="hs-identifier hs-var">uncurry</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">(&lt;/&gt;)</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1074"></span><span>    </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682041"><span class="hs-identifier hs-var">path</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682043"><span class="hs-identifier hs-var">baseName</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C.%3E"><span class="hs-operator hs-var">&lt;.&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682040"><span class="hs-identifier hs-var">ext</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1075"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621679682041"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682041"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; [String]
forall a. Eq a =&gt; [a] -&gt; [a]
</span><a href="../../base/src/Data.OldList.html#nub"><span class="hs-identifier hs-var">nub</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682044"><span class="hs-identifier hs-var">searchPath</span></a></span><span>
</span><span id="line-1076"></span><span>    </span><span class="hs-special">,</span><span> </span><span id="local-6989586621679682040"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682040"><span class="hs-identifier hs-var">ext</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; [String]
forall a. Eq a =&gt; [a] -&gt; [a]
</span><a href="../../base/src/Data.OldList.html#nub"><span class="hs-identifier hs-var">nub</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682045"><span class="hs-identifier hs-var">extensions</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-1077"></span><span>
</span><span id="line-1078"></span><span id="local-6989586621679683083"><span class="annot"><a href="Distribution.Simple.Utils.html#findFirstFile"><span class="hs-identifier hs-type">findFirstFile</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679683083"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679683083"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679683083"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-1079"></span><span id="findFirstFile"><span class="annot"><span class="annottext">findFirstFile :: forall a. (a -&gt; String) -&gt; [a] -&gt; IO (Maybe a)
</span><a href="Distribution.Simple.Utils.html#findFirstFile"><span class="hs-identifier hs-var hs-var">findFirstFile</span></a></span></span><span> </span><span id="local-6989586621679682036"><span class="annot"><span class="annottext">a -&gt; String
</span><a href="#local-6989586621679682036"><span class="hs-identifier hs-var">file</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[a] -&gt; IO (Maybe a)
</span><a href="#local-6989586621679682035"><span class="hs-identifier hs-var">findFirst</span></a></span><span>
</span><span id="line-1080"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679682035"><span class="annot"><span class="annottext">findFirst :: [a] -&gt; IO (Maybe a)
</span><a href="#local-6989586621679682035"><span class="hs-identifier hs-var hs-var">findFirst</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe a -&gt; IO (Maybe a)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe a
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-1081"></span><span>        </span><span class="annot"><a href="#local-6989586621679682035"><span class="hs-identifier hs-var">findFirst</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679682034"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679682034"><span class="hs-identifier hs-var">x</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679682033"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679682033"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621679682032"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679682032"><span class="hs-identifier hs-var">exists</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO Bool
</span><a href="../../directory/src/System.Directory.html#doesFileExist"><span class="hs-identifier hs-var">doesFileExist</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; String
</span><a href="#local-6989586621679682036"><span class="hs-identifier hs-var">file</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679682034"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1082"></span><span>                              </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679682032"><span class="hs-identifier hs-var">exists</span></a></span><span>
</span><span id="line-1083"></span><span>                                </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Maybe a -&gt; IO (Maybe a)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; Maybe a
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679682034"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1084"></span><span>                                </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">[a] -&gt; IO (Maybe a)
</span><a href="#local-6989586621679682035"><span class="hs-identifier hs-var">findFirst</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679682033"><span class="hs-identifier hs-var">xs</span></a></span><span>
</span><span id="line-1085"></span><span>
</span><span id="line-1086"></span><span id="local-6989586621679683079"><span class="annot"><a href="Distribution.Simple.Utils.html#findAllFiles"><span class="hs-identifier hs-type">findAllFiles</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679683079"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679683079"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679683079"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-1087"></span><span id="findAllFiles"><span class="annot"><span class="annottext">findAllFiles :: forall a. (a -&gt; String) -&gt; [a] -&gt; IO [a]
</span><a href="Distribution.Simple.Utils.html#findAllFiles"><span class="hs-identifier hs-var hs-var">findAllFiles</span></a></span></span><span> </span><span id="local-6989586621679682030"><span class="annot"><span class="annottext">a -&gt; String
</span><a href="#local-6989586621679682030"><span class="hs-identifier hs-var">file</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; IO Bool) -&gt; [a] -&gt; IO [a]
forall (m :: * -&gt; *) a.
Applicative m =&gt;
(a -&gt; m Bool) -&gt; [a] -&gt; m [a]
</span><a href="../../base/src/Control.Monad.html#filterM"><span class="hs-identifier hs-var">filterM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; IO Bool
</span><a href="../../directory/src/System.Directory.html#doesFileExist"><span class="hs-identifier hs-var">doesFileExist</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; IO Bool) -&gt; (a -&gt; String) -&gt; a -&gt; IO Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; String
</span><a href="#local-6989586621679682030"><span class="hs-identifier hs-var">file</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1088"></span><span>
</span><span id="line-1089"></span><span>
</span><span id="line-1090"></span><span class="hs-pragma">{-# DEPRECATED</span><span> </span><span class="hs-pragma">findModuleFiles</span><span> </span><span class="hs-pragma">&quot;Use findModuleFilesEx instead. This symbol will be removed in Cabal 3.2 (est. December 2019)&quot;</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1091"></span><span class="annot"><a href="Distribution.Simple.Utils.html#findModuleFiles"><span class="hs-identifier hs-type">findModuleFiles</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">]</span><span>   </span><span class="hs-comment">-- ^ build prefix (location of objects)</span><span>
</span><span id="line-1092"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span>     </span><span class="hs-comment">-- ^ search suffixes</span><span>
</span><span id="line-1093"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.ModuleName.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-comment">-- ^ modules</span><span>
</span><span id="line-1094"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-1095"></span><span id="findModuleFiles"><span class="annot"><span class="annottext">findModuleFiles :: [String] -&gt; [String] -&gt; [ModuleName] -&gt; IO [(String, String)]
</span><a href="Distribution.Simple.Utils.html#findModuleFiles"><span class="hs-identifier hs-var hs-var">findModuleFiles</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Verbosity
-&gt; [String] -&gt; [String] -&gt; [ModuleName] -&gt; IO [(String, String)]
</span><a href="Distribution.Simple.Utils.html#findModuleFilesEx"><span class="hs-identifier hs-var">findModuleFilesEx</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="Distribution.Verbosity.html#normal"><span class="hs-identifier hs-var">normal</span></a></span><span>
</span><span id="line-1096"></span><span>
</span><span id="line-1097"></span><span class="hs-comment">-- | Finds the files corresponding to a list of Haskell module names.</span><span>
</span><span id="line-1098"></span><span class="hs-comment">--</span><span>
</span><span id="line-1099"></span><span class="hs-comment">-- As 'findModuleFile' but for a list of module names.</span><span>
</span><span id="line-1100"></span><span class="hs-comment">--</span><span>
</span><span id="line-1101"></span><span class="annot"><a href="Distribution.Simple.Utils.html#findModuleFilesEx"><span class="hs-identifier hs-type">findModuleFilesEx</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span>
</span><span id="line-1102"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">]</span><span>   </span><span class="hs-comment">-- ^ build prefix (location of objects)</span><span>
</span><span id="line-1103"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span>     </span><span class="hs-comment">-- ^ search suffixes</span><span>
</span><span id="line-1104"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.ModuleName.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-comment">-- ^ modules</span><span>
</span><span id="line-1105"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-1106"></span><span id="findModuleFilesEx"><span class="annot"><span class="annottext">findModuleFilesEx :: Verbosity
-&gt; [String] -&gt; [String] -&gt; [ModuleName] -&gt; IO [(String, String)]
</span><a href="Distribution.Simple.Utils.html#findModuleFilesEx"><span class="hs-identifier hs-var hs-var">findModuleFilesEx</span></a></span></span><span> </span><span id="local-6989586621679682028"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682028"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679682027"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682027"><span class="hs-identifier hs-var">searchPath</span></a></span></span><span> </span><span id="local-6989586621679682026"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682026"><span class="hs-identifier hs-var">extensions</span></a></span></span><span> </span><span id="local-6989586621679682025"><span class="annot"><span class="annottext">[ModuleName]
</span><a href="#local-6989586621679682025"><span class="hs-identifier hs-var">moduleNames</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1107"></span><span>  </span><span class="annot"><span class="annottext">(ModuleName -&gt; IO (String, String))
-&gt; [ModuleName] -&gt; IO [(String, String)]
forall (t :: * -&gt; *) (f :: * -&gt; *) a b.
(Traversable t, Applicative f) =&gt;
(a -&gt; f b) -&gt; t a -&gt; f (t b)
</span><a href="../../base/src/Data.Traversable.html#traverse"><span class="hs-identifier hs-var">traverse</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Verbosity
-&gt; [String] -&gt; [String] -&gt; ModuleName -&gt; IO (String, String)
</span><a href="Distribution.Simple.Utils.html#findModuleFileEx"><span class="hs-identifier hs-var">findModuleFileEx</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682028"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682027"><span class="hs-identifier hs-var">searchPath</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682026"><span class="hs-identifier hs-var">extensions</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[ModuleName]
</span><a href="#local-6989586621679682025"><span class="hs-identifier hs-var">moduleNames</span></a></span><span>
</span><span id="line-1108"></span><span>
</span><span id="line-1109"></span><span class="hs-pragma">{-# DEPRECATED</span><span> </span><span class="hs-pragma">findModuleFile</span><span> </span><span class="hs-pragma">&quot;Use findModuleFileEx instead. This symbol will be removed in Cabal 3.2 (est. December 2019)&quot;</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-1110"></span><span class="annot"><a href="Distribution.Simple.Utils.html#findModuleFile"><span class="hs-identifier hs-type">findModuleFile</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">]</span><span>  </span><span class="hs-comment">-- ^ build prefix (location of objects)</span><span>
</span><span id="line-1111"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span>    </span><span class="hs-comment">-- ^ search suffixes</span><span>
</span><span id="line-1112"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.ModuleName.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span>  </span><span class="hs-comment">-- ^ module</span><span>
</span><span id="line-1113"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1114"></span><span id="findModuleFile"><span class="annot"><span class="annottext">findModuleFile :: [String] -&gt; [String] -&gt; ModuleName -&gt; IO (String, String)
</span><a href="Distribution.Simple.Utils.html#findModuleFile"><span class="hs-identifier hs-var hs-var">findModuleFile</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Verbosity
-&gt; [String] -&gt; [String] -&gt; ModuleName -&gt; IO (String, String)
</span><a href="Distribution.Simple.Utils.html#findModuleFileEx"><span class="hs-identifier hs-var">findModuleFileEx</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="Distribution.Verbosity.html#normal"><span class="hs-identifier hs-var">normal</span></a></span><span>
</span><span id="line-1115"></span><span>
</span><span id="line-1116"></span><span class="hs-comment">-- | Find the file corresponding to a Haskell module name.</span><span>
</span><span id="line-1117"></span><span class="hs-comment">--</span><span>
</span><span id="line-1118"></span><span class="hs-comment">-- This is similar to 'findFileWithExtension'' but specialised to a module</span><span>
</span><span id="line-1119"></span><span class="hs-comment">-- name. The function fails if the file corresponding to the module is missing.</span><span>
</span><span id="line-1120"></span><span class="hs-comment">--</span><span>
</span><span id="line-1121"></span><span class="annot"><a href="Distribution.Simple.Utils.html#findModuleFileEx"><span class="hs-identifier hs-type">findModuleFileEx</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span>
</span><span id="line-1122"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">]</span><span>  </span><span class="hs-comment">-- ^ build prefix (location of objects)</span><span>
</span><span id="line-1123"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span>    </span><span class="hs-comment">-- ^ search suffixes</span><span>
</span><span id="line-1124"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.ModuleName.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span>  </span><span class="hs-comment">-- ^ module</span><span>
</span><span id="line-1125"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1126"></span><span id="findModuleFileEx"><span class="annot"><span class="annottext">findModuleFileEx :: Verbosity
-&gt; [String] -&gt; [String] -&gt; ModuleName -&gt; IO (String, String)
</span><a href="Distribution.Simple.Utils.html#findModuleFileEx"><span class="hs-identifier hs-var hs-var">findModuleFileEx</span></a></span></span><span> </span><span id="local-6989586621679682023"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682023"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679682022"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682022"><span class="hs-identifier hs-var">searchPath</span></a></span></span><span> </span><span id="local-6989586621679682021"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682021"><span class="hs-identifier hs-var">extensions</span></a></span></span><span> </span><span id="local-6989586621679682020"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621679682020"><span class="hs-identifier hs-var">mod_name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1127"></span><span>      </span><span class="annot"><span class="annottext">IO (String, String)
-&gt; ((String, String) -&gt; IO (String, String))
-&gt; Maybe (String, String)
-&gt; IO (String, String)
forall b a. b -&gt; (a -&gt; b) -&gt; Maybe a -&gt; b
</span><a href="../../base/src/Data.Maybe.html#maybe"><span class="hs-identifier hs-var">maybe</span></a></span><span> </span><span class="annot"><span class="annottext">IO (String, String)
</span><a href="#local-6989586621679682019"><span class="hs-identifier hs-var">notFound</span></a></span><span> </span><span class="annot"><span class="annottext">(String, String) -&gt; IO (String, String)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span>
</span><span id="line-1128"></span><span>  </span><span class="annot"><span class="annottext">(Maybe (String, String) -&gt; IO (String, String))
-&gt; IO (Maybe (String, String)) -&gt; IO (String, String)
forall (m :: * -&gt; *) a b. Monad m =&gt; (a -&gt; m b) -&gt; m a -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3D%3C%3C"><span class="hs-operator hs-var">=&lt;&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">[String] -&gt; [String] -&gt; String -&gt; IO (Maybe (String, String))
</span><a href="Distribution.Simple.Utils.html#findFileWithExtension%27"><span class="hs-identifier hs-var">findFileWithExtension'</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682021"><span class="hs-identifier hs-var">extensions</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682022"><span class="hs-identifier hs-var">searchPath</span></a></span><span>
</span><span id="line-1129"></span><span>                             </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleName -&gt; String
</span><a href="Distribution.ModuleName.html#toFilePath"><span class="hs-identifier hs-var">ModuleName.toFilePath</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621679682020"><span class="hs-identifier hs-var">mod_name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1130"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1131"></span><span>    </span><span id="local-6989586621679682019"><span class="annot"><span class="annottext">notFound :: IO (String, String)
</span><a href="#local-6989586621679682019"><span class="hs-identifier hs-var hs-var">notFound</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; IO (String, String)
forall a. Verbosity -&gt; String -&gt; IO a
</span><a href="Distribution.Simple.Utils.html#die%27"><span class="hs-identifier hs-var">die'</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679682023"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; IO (String, String)) -&gt; String -&gt; IO (String, String)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-1132"></span><span>      </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Error: Could not find module: &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; String
forall a. Pretty a =&gt; a -&gt; String
</span><a href="Distribution.Pretty.html#prettyShow"><span class="hs-identifier hs-var">prettyShow</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621679682020"><span class="hs-identifier hs-var">mod_name</span></a></span><span>
</span><span id="line-1133"></span><span>      </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; with any suffix: &quot;</span></span><span>          </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[String] -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682021"><span class="hs-identifier hs-var">extensions</span></a></span><span>
</span><span id="line-1134"></span><span>      </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; in the search path: &quot;</span></span><span>       </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[String] -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682022"><span class="hs-identifier hs-var">searchPath</span></a></span><span>
</span><span id="line-1135"></span><span>
</span><span id="line-1136"></span><span class="hs-comment">-- | List all the files in a directory and all subdirectories.</span><span>
</span><span id="line-1137"></span><span class="hs-comment">--</span><span>
</span><span id="line-1138"></span><span class="hs-comment">-- The order places files in sub-directories after all the files in their</span><span>
</span><span id="line-1139"></span><span class="hs-comment">-- parent directories. The list is generated lazily so is not well defined if</span><span>
</span><span id="line-1140"></span><span class="hs-comment">-- the source directory structure changes before the list is used.</span><span>
</span><span id="line-1141"></span><span class="hs-comment">--</span><span>
</span><span id="line-1142"></span><span class="annot"><a href="Distribution.Simple.Utils.html#getDirectoryContentsRecursive"><span class="hs-identifier hs-type">getDirectoryContentsRecursive</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1143"></span><span id="getDirectoryContentsRecursive"><span class="annot"><span class="annottext">getDirectoryContentsRecursive :: String -&gt; IO [String]
</span><a href="Distribution.Simple.Utils.html#getDirectoryContentsRecursive"><span class="hs-identifier hs-var hs-var">getDirectoryContentsRecursive</span></a></span></span><span> </span><span id="local-6989586621679682016"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682016"><span class="hs-identifier hs-var">topdir</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; IO [String]
</span><a href="#local-6989586621679682015"><span class="hs-identifier hs-var">recurseDirectories</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span class="hs-special">]</span><span>
</span><span id="line-1144"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1145"></span><span>    </span><span class="annot"><a href="#local-6989586621679682015"><span class="hs-identifier hs-type">recurseDirectories</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1146"></span><span>    </span><span id="local-6989586621679682015"><span class="annot"><span class="annottext">recurseDirectories :: [String] -&gt; IO [String]
</span><a href="#local-6989586621679682015"><span class="hs-identifier hs-var hs-var">recurseDirectories</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; IO [String]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-1147"></span><span>    </span><span class="annot"><a href="#local-6989586621679682015"><span class="hs-identifier hs-var">recurseDirectories</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679682014"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682014"><span class="hs-identifier hs-var">dir</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679682013"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682013"><span class="hs-identifier hs-var">dirs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO [String] -&gt; IO [String]
forall a. IO a -&gt; IO a
</span><a href="../../base/src/GHC.IO.Unsafe.html#unsafeInterleaveIO"><span class="hs-identifier hs-var">unsafeInterleaveIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO [String] -&gt; IO [String]) -&gt; IO [String] -&gt; IO [String]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1148"></span><span>      </span><span class="hs-special">(</span><span id="local-6989586621679682012"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682012"><span class="hs-identifier hs-var">files</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679682011"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682011"><span class="hs-identifier hs-var">dirs'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; [String] -&gt; [String] -&gt; IO ([String], [String])
</span><a href="#local-6989586621679682010"><span class="hs-identifier hs-var">collect</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">([String] -&gt; IO ([String], [String]))
-&gt; IO [String] -&gt; IO ([String], [String])
forall (m :: * -&gt; *) a b. Monad m =&gt; (a -&gt; m b) -&gt; m a -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3D%3C%3C"><span class="hs-operator hs-var">=&lt;&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; IO [String]
</span><a href="../../directory/src/System.Directory.html#getDirectoryContents"><span class="hs-identifier hs-var">getDirectoryContents</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682016"><span class="hs-identifier hs-var">topdir</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682014"><span class="hs-identifier hs-var">dir</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1149"></span><span>      </span><span id="local-6989586621679682009"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682009"><span class="hs-identifier hs-var">files'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; IO [String]
</span><a href="#local-6989586621679682015"><span class="hs-identifier hs-var">recurseDirectories</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682011"><span class="hs-identifier hs-var">dirs'</span></a></span><span> </span><span class="annot"><span class="annottext">[String] -&gt; [String] -&gt; [String]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682013"><span class="hs-identifier hs-var">dirs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1150"></span><span>      </span><span class="annot"><span class="annottext">[String] -&gt; IO [String]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682012"><span class="hs-identifier hs-var">files</span></a></span><span> </span><span class="annot"><span class="annottext">[String] -&gt; [String] -&gt; [String]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682009"><span class="hs-identifier hs-var">files'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1151"></span><span>
</span><span id="line-1152"></span><span>      </span><span class="hs-keyword">where</span><span>
</span><span id="line-1153"></span><span>        </span><span id="local-6989586621679682010"><span class="annot"><span class="annottext">collect :: [String] -&gt; [String] -&gt; [String] -&gt; IO ([String], [String])
</span><a href="#local-6989586621679682010"><span class="hs-identifier hs-var hs-var">collect</span></a></span></span><span> </span><span id="local-6989586621679682008"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682008"><span class="hs-identifier hs-var">files</span></a></span></span><span> </span><span id="local-6989586621679682007"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682007"><span class="hs-identifier hs-var">dirs'</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>              </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([String], [String]) -&gt; IO ([String], [String])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[String] -&gt; [String]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682008"><span class="hs-identifier hs-var">files</span></a></span><span>
</span><span id="line-1154"></span><span>                                                     </span><span class="hs-special">,</span><span class="annot"><span class="annottext">[String] -&gt; [String]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682007"><span class="hs-identifier hs-var">dirs'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1155"></span><span>        </span><span class="annot"><a href="#local-6989586621679682010"><span class="hs-identifier hs-var">collect</span></a></span><span> </span><span id="local-6989586621679682006"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682006"><span class="hs-identifier hs-var">files</span></a></span></span><span> </span><span id="local-6989586621679682005"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682005"><span class="hs-identifier hs-var">dirs'</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679682004"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682004"><span class="hs-identifier hs-var">entry</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679682003"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682003"><span class="hs-identifier hs-var">entries</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">String -&gt; Bool
</span><a href="#local-6989586621679682002"><span class="hs-identifier hs-var">ignore</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682004"><span class="hs-identifier hs-var">entry</span></a></span><span>
</span><span id="line-1156"></span><span>                                            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; [String] -&gt; [String] -&gt; IO ([String], [String])
</span><a href="#local-6989586621679682010"><span class="hs-identifier hs-var">collect</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682006"><span class="hs-identifier hs-var">files</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682005"><span class="hs-identifier hs-var">dirs'</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682003"><span class="hs-identifier hs-var">entries</span></a></span><span>
</span><span id="line-1157"></span><span>        </span><span class="annot"><a href="#local-6989586621679682010"><span class="hs-identifier hs-var">collect</span></a></span><span> </span><span id="local-6989586621679682001"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682001"><span class="hs-identifier hs-var">files</span></a></span></span><span> </span><span id="local-6989586621679682000"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682000"><span class="hs-identifier hs-var">dirs'</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679681999"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681999"><span class="hs-identifier hs-var">entry</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679681998"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679681998"><span class="hs-identifier hs-var">entries</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1158"></span><span>          </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679681997"><span class="annot"><span class="annottext">dirEntry :: String
</span><a href="#local-6989586621679681997"><span class="hs-identifier hs-var hs-var">dirEntry</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682014"><span class="hs-identifier hs-var">dir</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681999"><span class="hs-identifier hs-var">entry</span></a></span><span>
</span><span id="line-1159"></span><span>          </span><span id="local-6989586621679681996"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679681996"><span class="hs-identifier hs-var">isDirectory</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO Bool
</span><a href="../../directory/src/System.Directory.html#doesDirectoryExist"><span class="hs-identifier hs-var">doesDirectoryExist</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679682016"><span class="hs-identifier hs-var">topdir</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681997"><span class="hs-identifier hs-var">dirEntry</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1160"></span><span>          </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679681996"><span class="hs-identifier hs-var">isDirectory</span></a></span><span>
</span><span id="line-1161"></span><span>            </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; [String] -&gt; [String] -&gt; IO ([String], [String])
</span><a href="#local-6989586621679682010"><span class="hs-identifier hs-var">collect</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682001"><span class="hs-identifier hs-var">files</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681997"><span class="hs-identifier hs-var">dirEntry</span></a></span><span class="annot"><span class="annottext">String -&gt; [String] -&gt; [String]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682000"><span class="hs-identifier hs-var">dirs'</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679681998"><span class="hs-identifier hs-var">entries</span></a></span><span>
</span><span id="line-1162"></span><span>            </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; [String] -&gt; [String] -&gt; IO ([String], [String])
</span><a href="#local-6989586621679682010"><span class="hs-identifier hs-var">collect</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681997"><span class="hs-identifier hs-var">dirEntry</span></a></span><span class="annot"><span class="annottext">String -&gt; [String] -&gt; [String]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682001"><span class="hs-identifier hs-var">files</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679682000"><span class="hs-identifier hs-var">dirs'</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679681998"><span class="hs-identifier hs-var">entries</span></a></span><span>
</span><span id="line-1163"></span><span>
</span><span id="line-1164"></span><span>        </span><span id="local-6989586621679682002"><span class="annot"><span class="annottext">ignore :: String -&gt; Bool
</span><a href="#local-6989586621679682002"><span class="hs-identifier hs-var hs-var">ignore</span></a></span></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'.'</span></span><span class="hs-special">]</span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1165"></span><span>        </span><span class="annot"><a href="#local-6989586621679682002"><span class="hs-identifier hs-var">ignore</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'.'</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'.'</span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1166"></span><span>        </span><span class="annot"><a href="#local-6989586621679682002"><span class="hs-identifier hs-var">ignore</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1167"></span><span>
</span><span id="line-1168"></span><span class="hs-comment">------------------------</span><span>
</span><span id="line-1169"></span><span class="hs-comment">-- Environment variables</span><span>
</span><span id="line-1170"></span><span>
</span><span id="line-1171"></span><span class="hs-comment">-- | Is this directory in the system search path?</span><span>
</span><span id="line-1172"></span><span class="annot"><a href="Distribution.Simple.Utils.html#isInSearchPath"><span class="hs-identifier hs-type">isInSearchPath</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1173"></span><span id="isInSearchPath"><span class="annot"><span class="annottext">isInSearchPath :: String -&gt; IO Bool
</span><a href="Distribution.Simple.Utils.html#isInSearchPath"><span class="hs-identifier hs-var hs-var">isInSearchPath</span></a></span></span><span> </span><span id="local-6989586621679681995"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681995"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([String] -&gt; Bool) -&gt; IO [String] -&gt; IO Bool
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; [String] -&gt; Bool
forall (t :: * -&gt; *) a. (Foldable t, Eq a) =&gt; a -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#elem"><span class="hs-identifier hs-var">elem</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681995"><span class="hs-identifier hs-var">path</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">IO [String]
</span><a href="../../filepath/src/System.FilePath.Windows.html#getSearchPath"><span class="hs-identifier hs-var">getSearchPath</span></a></span><span>
</span><span id="line-1174"></span><span>
</span><span id="line-1175"></span><span class="annot"><a href="Distribution.Simple.Utils.html#addLibraryPath"><span class="hs-identifier hs-type">addLibraryPath</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.System.html#OS"><span class="hs-identifier hs-type">OS</span></a></span><span>
</span><span id="line-1176"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1177"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-1178"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">,</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-1179"></span><span id="addLibraryPath"><span class="annot"><span class="annottext">addLibraryPath :: OS -&gt; [String] -&gt; [(String, String)] -&gt; [(String, String)]
</span><a href="Distribution.Simple.Utils.html#addLibraryPath"><span class="hs-identifier hs-var hs-var">addLibraryPath</span></a></span></span><span> </span><span id="local-6989586621679681993"><span class="annot"><span class="annottext">OS
</span><a href="#local-6989586621679681993"><span class="hs-identifier hs-var">os</span></a></span></span><span> </span><span id="local-6989586621679681992"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679681992"><span class="hs-identifier hs-var">paths</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(String, String)] -&gt; [(String, String)]
</span><a href="#local-6989586621679681991"><span class="hs-identifier hs-var">addEnv</span></a></span><span>
</span><span id="line-1180"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1181"></span><span>    </span><span id="local-6989586621679681990"><span class="annot"><span class="annottext">pathsString :: String
</span><a href="#local-6989586621679681990"><span class="hs-identifier hs-var hs-var">pathsString</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; [String] -&gt; String
forall a. [a] -&gt; [[a]] -&gt; [a]
</span><a href="../../base/src/Data.OldList.html#intercalate"><span class="hs-identifier hs-var">intercalate</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Char
</span><a href="../../filepath/src/System.FilePath.Windows.html#searchPathSeparator"><span class="hs-identifier hs-var">searchPathSeparator</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679681992"><span class="hs-identifier hs-var">paths</span></a></span><span>
</span><span id="line-1182"></span><span>    </span><span id="local-6989586621679681989"><span class="annot"><span class="annottext">ldPath :: String
</span><a href="#local-6989586621679681989"><span class="hs-identifier hs-var hs-var">ldPath</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">OS
</span><a href="#local-6989586621679681993"><span class="hs-identifier hs-var">os</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1183"></span><span>               </span><span class="annot"><span class="annottext">OS
</span><a href="Distribution.System.html#OSX"><span class="hs-identifier hs-var">OSX</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;DYLD_LIBRARY_PATH&quot;</span></span><span>
</span><span id="line-1184"></span><span>               </span><span class="annot"><span class="annottext">OS
</span><span class="hs-identifier">_</span></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;LD_LIBRARY_PATH&quot;</span></span><span>
</span><span id="line-1185"></span><span>
</span><span id="line-1186"></span><span>    </span><span id="local-6989586621679681991"><span class="annot"><span class="annottext">addEnv :: [(String, String)] -&gt; [(String, String)]
</span><a href="#local-6989586621679681991"><span class="hs-identifier hs-var hs-var">addEnv</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681989"><span class="hs-identifier hs-var">ldPath</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681990"><span class="hs-identifier hs-var">pathsString</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-1187"></span><span>    </span><span class="annot"><a href="#local-6989586621679681991"><span class="hs-identifier hs-var">addEnv</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span id="local-6989586621679681987"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681987"><span class="hs-identifier hs-var">key</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679681986"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681986"><span class="hs-identifier hs-var">value</span></a></span></span><span class="hs-special">)</span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679681985"><span class="annot"><span class="annottext">[(String, String)]
</span><a href="#local-6989586621679681985"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1188"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681987"><span class="hs-identifier hs-var">key</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681989"><span class="hs-identifier hs-var">ldPath</span></a></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1189"></span><span>          </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">String -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681986"><span class="hs-identifier hs-var">value</span></a></span><span>
</span><span id="line-1190"></span><span>             </span><span class="hs-keyword">then</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681987"><span class="hs-identifier hs-var">key</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681990"><span class="hs-identifier hs-var">pathsString</span></a></span><span class="hs-special">)</span><span class="annot"><span class="annottext">(String, String) -&gt; [(String, String)] -&gt; [(String, String)]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[(String, String)]
</span><a href="#local-6989586621679681985"><span class="hs-identifier hs-var">xs</span></a></span><span>
</span><span id="line-1191"></span><span>             </span><span class="hs-keyword">else</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681987"><span class="hs-identifier hs-var">key</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681986"><span class="hs-identifier hs-var">value</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><a href="../../filepath/src/System.FilePath.Windows.html#searchPathSeparator"><span class="hs-identifier hs-var">searchPathSeparator</span></a></span><span class="annot"><span class="annottext">Char -&gt; String -&gt; String
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681990"><span class="hs-identifier hs-var">pathsString</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="annot"><span class="annottext">(String, String) -&gt; [(String, String)] -&gt; [(String, String)]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[(String, String)]
</span><a href="#local-6989586621679681985"><span class="hs-identifier hs-var">xs</span></a></span><span>
</span><span id="line-1192"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681987"><span class="hs-identifier hs-var">key</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681986"><span class="hs-identifier hs-var">value</span></a></span><span class="hs-special">)</span><span class="annot"><span class="annottext">(String, String) -&gt; [(String, String)] -&gt; [(String, String)]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[(String, String)] -&gt; [(String, String)]
</span><a href="#local-6989586621679681991"><span class="hs-identifier hs-var">addEnv</span></a></span><span> </span><span class="annot"><span class="annottext">[(String, String)]
</span><a href="#local-6989586621679681985"><span class="hs-identifier hs-var">xs</span></a></span><span>
</span><span id="line-1193"></span><span>
</span><span id="line-1194"></span><span class="hs-comment">--------------------</span><span>
</span><span id="line-1195"></span><span class="hs-comment">-- Modification time</span><span>
</span><span id="line-1196"></span><span>
</span><span id="line-1197"></span><span class="hs-comment">-- | Compare the modification times of two files to see if the first is newer</span><span>
</span><span id="line-1198"></span><span class="hs-comment">-- than the second. The first file must exist but the second need not.</span><span>
</span><span id="line-1199"></span><span class="hs-comment">-- The expected use case is when the second file is generated using the first.</span><span>
</span><span id="line-1200"></span><span class="hs-comment">-- In this use case, if the result is True then the second file is out of date.</span><span>
</span><span id="line-1201"></span><span class="hs-comment">--</span><span>
</span><span id="line-1202"></span><span class="annot"><a href="Distribution.Simple.Utils.html#moreRecentFile"><span class="hs-identifier hs-type">moreRecentFile</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1203"></span><span id="moreRecentFile"><span class="annot"><span class="annottext">moreRecentFile :: String -&gt; String -&gt; IO Bool
</span><a href="Distribution.Simple.Utils.html#moreRecentFile"><span class="hs-identifier hs-var hs-var">moreRecentFile</span></a></span></span><span> </span><span id="local-6989586621679681984"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681984"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621679681983"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681983"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1204"></span><span>  </span><span id="local-6989586621679681982"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679681982"><span class="hs-identifier hs-var">exists</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO Bool
</span><a href="../../directory/src/System.Directory.html#doesFileExist"><span class="hs-identifier hs-var">doesFileExist</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681983"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-1205"></span><span>  </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679681982"><span class="hs-identifier hs-var">exists</span></a></span><span>
</span><span id="line-1206"></span><span>    </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; IO Bool
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1207"></span><span>    </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621679681981"><span class="annot"><span class="annottext">UTCTime
</span><a href="#local-6989586621679681981"><span class="hs-identifier hs-var">tb</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO UTCTime
</span><a href="../../directory/src/System.Directory.html#getModificationTime"><span class="hs-identifier hs-var">getModificationTime</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681983"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-1208"></span><span>            </span><span id="local-6989586621679681980"><span class="annot"><span class="annottext">UTCTime
</span><a href="#local-6989586621679681980"><span class="hs-identifier hs-var">ta</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO UTCTime
</span><a href="../../directory/src/System.Directory.html#getModificationTime"><span class="hs-identifier hs-var">getModificationTime</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681984"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-1209"></span><span>            </span><span class="annot"><span class="annottext">Bool -&gt; IO Bool
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UTCTime
</span><a href="#local-6989586621679681980"><span class="hs-identifier hs-var">ta</span></a></span><span> </span><span class="annot"><span class="annottext">UTCTime -&gt; UTCTime -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;</span></span><span> </span><span class="annot"><span class="annottext">UTCTime
</span><a href="#local-6989586621679681981"><span class="hs-identifier hs-var">tb</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1210"></span><span>
</span><span id="line-1211"></span><span class="hs-comment">-- | Like 'moreRecentFile', but also checks that the first file exists.</span><span>
</span><span id="line-1212"></span><span class="annot"><a href="Distribution.Simple.Utils.html#existsAndIsMoreRecentThan"><span class="hs-identifier hs-type">existsAndIsMoreRecentThan</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1213"></span><span id="existsAndIsMoreRecentThan"><span class="annot"><span class="annottext">existsAndIsMoreRecentThan :: String -&gt; String -&gt; IO Bool
</span><a href="Distribution.Simple.Utils.html#existsAndIsMoreRecentThan"><span class="hs-identifier hs-var hs-var">existsAndIsMoreRecentThan</span></a></span></span><span> </span><span id="local-6989586621679681978"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681978"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621679681977"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681977"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1214"></span><span>  </span><span id="local-6989586621679681976"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679681976"><span class="hs-identifier hs-var">exists</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO Bool
</span><a href="../../directory/src/System.Directory.html#doesFileExist"><span class="hs-identifier hs-var">doesFileExist</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681978"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-1215"></span><span>  </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679681976"><span class="hs-identifier hs-var">exists</span></a></span><span>
</span><span id="line-1216"></span><span>    </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; IO Bool
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1217"></span><span>    </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681978"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; IO Bool
</span><a href="Distribution.Simple.Utils.html#moreRecentFile"><span class="hs-operator hs-var">`moreRecentFile`</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681977"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-1218"></span><span>
</span><span id="line-1219"></span><span class="hs-comment">----------------------------------------</span><span>
</span><span id="line-1220"></span><span class="hs-comment">-- Copying and installing files and dirs</span><span>
</span><span id="line-1221"></span><span>
</span><span id="line-1222"></span><span class="hs-comment">-- | Same as 'createDirectoryIfMissing' but logs at higher verbosity levels.</span><span>
</span><span id="line-1223"></span><span class="hs-comment">--</span><span>
</span><span id="line-1224"></span><span class="annot"><a href="Distribution.Simple.Utils.html#createDirectoryIfMissingVerbose"><span class="hs-identifier hs-type">createDirectoryIfMissingVerbose</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span>
</span><span id="line-1225"></span><span>                                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>     </span><span class="hs-comment">-- ^ Create its parents too?</span><span>
</span><span id="line-1226"></span><span>                                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-1227"></span><span>                                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-1228"></span><span id="createDirectoryIfMissingVerbose"><span class="annot"><span class="annottext">createDirectoryIfMissingVerbose :: Verbosity -&gt; Bool -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#createDirectoryIfMissingVerbose"><span class="hs-identifier hs-var hs-var">createDirectoryIfMissingVerbose</span></a></span></span><span> </span><span id="local-6989586621679681975"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681975"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679681974"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679681974"><span class="hs-identifier hs-var">create_parents</span></a></span></span><span> </span><span id="local-6989586621679681973"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681973"><span class="hs-identifier hs-var">path0</span></a></span></span><span>
</span><span id="line-1229"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679681974"><span class="hs-identifier hs-var">create_parents</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HasCallStack =&gt; IO ()) -&gt; IO ()
forall a. HasCallStack =&gt; (HasCallStack =&gt; a) -&gt; a
</span><a href="../../base/src/GHC.Stack.html#withFrozenCallStack"><span class="hs-identifier hs-var">withFrozenCallStack</span></a></span><span> </span><span class="annot"><span class="annottext">((HasCallStack =&gt; IO ()) -&gt; IO ())
-&gt; (HasCallStack =&gt; IO ()) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[String] -&gt; IO ()
</span><a href="#local-6989586621679681971"><span class="hs-identifier hs-var">createDirs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; [String]
</span><a href="#local-6989586621679681970"><span class="hs-identifier hs-var">parents</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681973"><span class="hs-identifier hs-var">path0</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1230"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HasCallStack =&gt; IO ()) -&gt; IO ()
forall a. HasCallStack =&gt; (HasCallStack =&gt; a) -&gt; a
</span><a href="../../base/src/GHC.Stack.html#withFrozenCallStack"><span class="hs-identifier hs-var">withFrozenCallStack</span></a></span><span> </span><span class="annot"><span class="annottext">((HasCallStack =&gt; IO ()) -&gt; IO ())
-&gt; (HasCallStack =&gt; IO ()) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[String] -&gt; IO ()
</span><a href="#local-6989586621679681971"><span class="hs-identifier hs-var">createDirs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; [String] -&gt; [String]
forall a. Int -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#take"><span class="hs-identifier hs-var">take</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; [String]
</span><a href="#local-6989586621679681970"><span class="hs-identifier hs-var">parents</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681973"><span class="hs-identifier hs-var">path0</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1231"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1232"></span><span>    </span><span id="local-6989586621679681970"><span class="annot"><span class="annottext">parents :: String -&gt; [String]
</span><a href="#local-6989586621679681970"><span class="hs-identifier hs-var hs-var">parents</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; [String]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">([String] -&gt; [String])
-&gt; (String -&gt; [String]) -&gt; String -&gt; [String]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; String -&gt; String) -&gt; [String] -&gt; [String]
forall a. (a -&gt; a -&gt; a) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#scanl1"><span class="hs-identifier hs-var">scanl1</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">(&lt;/&gt;)</span></a></span><span> </span><span class="annot"><span class="annottext">([String] -&gt; [String])
-&gt; (String -&gt; [String]) -&gt; String -&gt; [String]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; [String]
</span><a href="../../filepath/src/System.FilePath.Windows.html#splitDirectories"><span class="hs-identifier hs-var">splitDirectories</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; [String]) -&gt; (String -&gt; String) -&gt; String -&gt; [String]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#normalise"><span class="hs-identifier hs-var">normalise</span></a></span><span>
</span><span id="line-1233"></span><span>
</span><span id="line-1234"></span><span>    </span><span id="local-6989586621679681971"><span class="annot"><span class="annottext">createDirs :: [String] -&gt; IO ()
</span><a href="#local-6989586621679681971"><span class="hs-identifier hs-var hs-var">createDirs</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-1235"></span><span>    </span><span class="annot"><a href="#local-6989586621679681971"><span class="hs-identifier hs-var">createDirs</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679681962"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681962"><span class="hs-identifier hs-var">dir</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; (IOException -&gt; IO ()) -&gt; IO ()
</span><a href="#local-6989586621679681961"><span class="hs-identifier hs-var">createDir</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681962"><span class="hs-identifier hs-var">dir</span></a></span><span> </span><span class="annot"><span class="annottext">IOException -&gt; IO ()
forall e a. Exception e =&gt; e -&gt; IO a
</span><a href="../../base/src/GHC.IO.html#throwIO"><span class="hs-identifier hs-var">throwIO</span></a></span><span>
</span><span id="line-1236"></span><span>    </span><span class="annot"><a href="#local-6989586621679681971"><span class="hs-identifier hs-var">createDirs</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679681960"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681960"><span class="hs-identifier hs-var">dir</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679681959"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679681959"><span class="hs-identifier hs-var">dirs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1237"></span><span>      </span><span class="annot"><span class="annottext">String -&gt; (IOException -&gt; IO ()) -&gt; IO ()
</span><a href="#local-6989586621679681961"><span class="hs-identifier hs-var">createDir</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681960"><span class="hs-identifier hs-var">dir</span></a></span><span> </span><span class="annot"><span class="annottext">((IOException -&gt; IO ()) -&gt; IO ())
-&gt; (IOException -&gt; IO ()) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">IOException
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1238"></span><span>        </span><span class="annot"><span class="annottext">[String] -&gt; IO ()
</span><a href="#local-6989586621679681971"><span class="hs-identifier hs-var">createDirs</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679681959"><span class="hs-identifier hs-var">dirs</span></a></span><span>
</span><span id="line-1239"></span><span>        </span><span class="annot"><span class="annottext">String -&gt; (IOException -&gt; IO ()) -&gt; IO ()
</span><a href="#local-6989586621679681961"><span class="hs-identifier hs-var">createDir</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681960"><span class="hs-identifier hs-var">dir</span></a></span><span> </span><span class="annot"><span class="annottext">IOException -&gt; IO ()
forall e a. Exception e =&gt; e -&gt; IO a
</span><a href="../../base/src/GHC.IO.html#throwIO"><span class="hs-identifier hs-var">throwIO</span></a></span><span>
</span><span id="line-1240"></span><span>
</span><span id="line-1241"></span><span>    </span><span class="annot"><a href="#local-6989586621679681961"><span class="hs-identifier hs-type">createDir</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IO.Exception.html#IOException"><span class="hs-identifier hs-type">IOException</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-1242"></span><span>    </span><span id="local-6989586621679681961"><span class="annot"><span class="annottext">createDir :: String -&gt; (IOException -&gt; IO ()) -&gt; IO ()
</span><a href="#local-6989586621679681961"><span class="hs-identifier hs-var hs-var">createDir</span></a></span></span><span> </span><span id="local-6989586621679681958"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681958"><span class="hs-identifier hs-var">dir</span></a></span></span><span> </span><span id="local-6989586621679681957"><span class="annot"><span class="annottext">IOException -&gt; IO ()
</span><a href="#local-6989586621679681957"><span class="hs-identifier hs-var">notExistHandler</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1243"></span><span>      </span><span id="local-6989586621679681956"><span class="annot"><span class="annottext">Either IOException ()
</span><a href="#local-6989586621679681956"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO () -&gt; IO (Either IOException ())
forall a. IO a -&gt; IO (Either IOException a)
</span><a href="Distribution.Compat.Exception.html#tryIO"><span class="hs-identifier hs-var">tryIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO (Either IOException ()))
-&gt; IO () -&gt; IO (Either IOException ())
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#createDirectoryVerbose"><span class="hs-identifier hs-var">createDirectoryVerbose</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681975"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681958"><span class="hs-identifier hs-var">dir</span></a></span><span>
</span><span id="line-1244"></span><span>      </span><span class="hs-keyword">case</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Either IOException ()
</span><a href="#local-6989586621679681956"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Exception.html#IOException"><span class="hs-identifier hs-type">IOException</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1245"></span><span>        </span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-1246"></span><span>        </span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span>  </span><span id="local-6989586621679681953"><span class="annot"><span class="annottext">IOException
</span><a href="#local-6989586621679681953"><span class="hs-identifier hs-var">e</span></a></span></span><span>
</span><span id="line-1247"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">IOException -&gt; Bool
</span><a href="../../base/src/System.IO.Error.html#isDoesNotExistError"><span class="hs-identifier hs-var">isDoesNotExistError</span></a></span><span>  </span><span class="annot"><span class="annottext">IOException
</span><a href="#local-6989586621679681953"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">IOException -&gt; IO ()
</span><a href="#local-6989586621679681957"><span class="hs-identifier hs-var">notExistHandler</span></a></span><span> </span><span class="annot"><span class="annottext">IOException
</span><a href="#local-6989586621679681953"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-1248"></span><span>          </span><span class="hs-comment">-- createDirectory (and indeed POSIX mkdir) does not distinguish</span><span>
</span><span id="line-1249"></span><span>          </span><span class="hs-comment">-- between a dir already existing and a file already existing. So we</span><span>
</span><span id="line-1250"></span><span>          </span><span class="hs-comment">-- check for it here. Unfortunately there is a slight race condition</span><span>
</span><span id="line-1251"></span><span>          </span><span class="hs-comment">-- here, but we think it is benign. It could report an exception in</span><span>
</span><span id="line-1252"></span><span>          </span><span class="hs-comment">-- the case that the dir did exist but another process deletes the</span><span>
</span><span id="line-1253"></span><span>          </span><span class="hs-comment">-- directory and creates a file in its place before we can check</span><span>
</span><span id="line-1254"></span><span>          </span><span class="hs-comment">-- that the directory did indeed exist.</span><span>
</span><span id="line-1255"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">IOException -&gt; Bool
</span><a href="../../base/src/System.IO.Error.html#isAlreadyExistsError"><span class="hs-identifier hs-var">isAlreadyExistsError</span></a></span><span> </span><span class="annot"><span class="annottext">IOException
</span><a href="#local-6989586621679681953"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-keyword">do</span><span>
</span><span id="line-1256"></span><span>              </span><span id="local-6989586621679681951"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679681951"><span class="hs-identifier hs-var">isDir</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO Bool
</span><a href="../../directory/src/System.Directory.html#doesDirectoryExist"><span class="hs-identifier hs-var">doesDirectoryExist</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681958"><span class="hs-identifier hs-var">dir</span></a></span><span>
</span><span id="line-1257"></span><span>              </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#unless"><span class="hs-identifier hs-var">unless</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679681951"><span class="hs-identifier hs-var">isDir</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">IOException -&gt; IO ()
forall e a. Exception e =&gt; e -&gt; IO a
</span><a href="../../base/src/GHC.IO.html#throwIO"><span class="hs-identifier hs-var">throwIO</span></a></span><span> </span><span class="annot"><span class="annottext">IOException
</span><a href="#local-6989586621679681953"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-1258"></span><span>              </span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">IO () -&gt; (IOException -&gt; IO ()) -&gt; IO ()
forall a. IO a -&gt; (IOException -&gt; IO a) -&gt; IO a
</span><a href="Distribution.Compat.Exception.html#catchIO"><span class="hs-operator hs-var">`catchIO`</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">IOException
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Exception.html#IOException"><span class="hs-identifier hs-type">IOException</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1259"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">IOException -&gt; IO ()
forall e a. Exception e =&gt; e -&gt; IO a
</span><a href="../../base/src/GHC.IO.html#throwIO"><span class="hs-identifier hs-var">throwIO</span></a></span><span> </span><span class="annot"><span class="annottext">IOException
</span><a href="#local-6989586621679681953"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-1260"></span><span>
</span><span id="line-1261"></span><span class="annot"><a href="Distribution.Simple.Utils.html#createDirectoryVerbose"><span class="hs-identifier hs-type">createDirectoryVerbose</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-1262"></span><span id="createDirectoryVerbose"><span class="annot"><span class="annottext">createDirectoryVerbose :: Verbosity -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#createDirectoryVerbose"><span class="hs-identifier hs-var hs-var">createDirectoryVerbose</span></a></span></span><span> </span><span id="local-6989586621679681950"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681950"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679681949"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681949"><span class="hs-identifier hs-var">dir</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HasCallStack =&gt; IO ()) -&gt; IO ()
forall a. HasCallStack =&gt; (HasCallStack =&gt; a) -&gt; a
</span><a href="../../base/src/GHC.Stack.html#withFrozenCallStack"><span class="hs-identifier hs-var">withFrozenCallStack</span></a></span><span> </span><span class="annot"><span class="annottext">((HasCallStack =&gt; IO ()) -&gt; IO ())
-&gt; (HasCallStack =&gt; IO ()) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1263"></span><span>  </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#info"><span class="hs-identifier hs-var">info</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681950"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; IO ()) -&gt; String -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;creating &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681949"><span class="hs-identifier hs-var">dir</span></a></span><span>
</span><span id="line-1264"></span><span>  </span><span class="annot"><span class="annottext">String -&gt; IO ()
</span><a href="../../directory/src/System.Directory.html#createDirectory"><span class="hs-identifier hs-var">createDirectory</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681949"><span class="hs-identifier hs-var">dir</span></a></span><span>
</span><span id="line-1265"></span><span>  </span><span class="annot"><span class="annottext">String -&gt; IO ()
</span><a href="Distribution.Compat.CopyFile.html#setDirOrdinary"><span class="hs-identifier hs-var">setDirOrdinary</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681949"><span class="hs-identifier hs-var">dir</span></a></span><span>
</span><span id="line-1266"></span><span>
</span><span id="line-1267"></span><span class="hs-comment">-- | Copies a file without copying file permissions. The target file is created</span><span>
</span><span id="line-1268"></span><span class="hs-comment">-- with default permissions. Any existing target file is replaced.</span><span>
</span><span id="line-1269"></span><span class="hs-comment">--</span><span>
</span><span id="line-1270"></span><span class="hs-comment">-- At higher verbosity levels it logs an info message.</span><span>
</span><span id="line-1271"></span><span class="hs-comment">--</span><span>
</span><span id="line-1272"></span><span class="annot"><a href="Distribution.Simple.Utils.html#copyFileVerbose"><span class="hs-identifier hs-type">copyFileVerbose</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-1273"></span><span id="copyFileVerbose"><span class="annot"><span class="annottext">copyFileVerbose :: Verbosity -&gt; String -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#copyFileVerbose"><span class="hs-identifier hs-var hs-var">copyFileVerbose</span></a></span></span><span> </span><span id="local-6989586621679681944"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681944"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679681943"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681943"><span class="hs-identifier hs-var">src</span></a></span></span><span> </span><span id="local-6989586621679681942"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681942"><span class="hs-identifier hs-var">dest</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HasCallStack =&gt; IO ()) -&gt; IO ()
forall a. HasCallStack =&gt; (HasCallStack =&gt; a) -&gt; a
</span><a href="../../base/src/GHC.Stack.html#withFrozenCallStack"><span class="hs-identifier hs-var">withFrozenCallStack</span></a></span><span> </span><span class="annot"><span class="annottext">((HasCallStack =&gt; IO ()) -&gt; IO ())
-&gt; (HasCallStack =&gt; IO ()) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1274"></span><span>  </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#info"><span class="hs-identifier hs-var">info</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681944"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;copy &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681943"><span class="hs-identifier hs-var">src</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; to &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681942"><span class="hs-identifier hs-var">dest</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1275"></span><span>  </span><span class="annot"><span class="annottext">String -&gt; String -&gt; IO ()
</span><a href="Distribution.Compat.CopyFile.html#copyFile"><span class="hs-identifier hs-var">copyFile</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681943"><span class="hs-identifier hs-var">src</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681942"><span class="hs-identifier hs-var">dest</span></a></span><span>
</span><span id="line-1276"></span><span>
</span><span id="line-1277"></span><span class="hs-comment">-- | Install an ordinary file. This is like a file copy but the permissions</span><span>
</span><span id="line-1278"></span><span class="hs-comment">-- are set appropriately for an installed file. On Unix it is \&quot;-rw-r--r--\&quot;</span><span>
</span><span id="line-1279"></span><span class="hs-comment">-- while on Windows it uses the default permissions for the target directory.</span><span>
</span><span id="line-1280"></span><span class="hs-comment">--</span><span>
</span><span id="line-1281"></span><span class="annot"><a href="Distribution.Simple.Utils.html#installOrdinaryFile"><span class="hs-identifier hs-type">installOrdinaryFile</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-1282"></span><span id="installOrdinaryFile"><span class="annot"><span class="annottext">installOrdinaryFile :: Verbosity -&gt; String -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#installOrdinaryFile"><span class="hs-identifier hs-var hs-var">installOrdinaryFile</span></a></span></span><span> </span><span id="local-6989586621679681938"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681938"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679681937"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681937"><span class="hs-identifier hs-var">src</span></a></span></span><span> </span><span id="local-6989586621679681936"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681936"><span class="hs-identifier hs-var">dest</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HasCallStack =&gt; IO ()) -&gt; IO ()
forall a. HasCallStack =&gt; (HasCallStack =&gt; a) -&gt; a
</span><a href="../../base/src/GHC.Stack.html#withFrozenCallStack"><span class="hs-identifier hs-var">withFrozenCallStack</span></a></span><span> </span><span class="annot"><span class="annottext">((HasCallStack =&gt; IO ()) -&gt; IO ())
-&gt; (HasCallStack =&gt; IO ()) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1283"></span><span>  </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#info"><span class="hs-identifier hs-var">info</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681938"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Installing &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681937"><span class="hs-identifier hs-var">src</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; to &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681936"><span class="hs-identifier hs-var">dest</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1284"></span><span>  </span><span class="annot"><span class="annottext">String -&gt; String -&gt; IO ()
</span><a href="Distribution.Compat.CopyFile.html#copyOrdinaryFile"><span class="hs-identifier hs-var">copyOrdinaryFile</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681937"><span class="hs-identifier hs-var">src</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681936"><span class="hs-identifier hs-var">dest</span></a></span><span>
</span><span id="line-1285"></span><span>
</span><span id="line-1286"></span><span class="hs-comment">-- | Install an executable file. This is like a file copy but the permissions</span><span>
</span><span id="line-1287"></span><span class="hs-comment">-- are set appropriately for an installed file. On Unix it is \&quot;-rwxr-xr-x\&quot;</span><span>
</span><span id="line-1288"></span><span class="hs-comment">-- while on Windows it uses the default permissions for the target directory.</span><span>
</span><span id="line-1289"></span><span class="hs-comment">--</span><span>
</span><span id="line-1290"></span><span class="annot"><a href="Distribution.Simple.Utils.html#installExecutableFile"><span class="hs-identifier hs-type">installExecutableFile</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-1291"></span><span id="installExecutableFile"><span class="annot"><span class="annottext">installExecutableFile :: Verbosity -&gt; String -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#installExecutableFile"><span class="hs-identifier hs-var hs-var">installExecutableFile</span></a></span></span><span> </span><span id="local-6989586621679681932"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681932"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679681931"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681931"><span class="hs-identifier hs-var">src</span></a></span></span><span> </span><span id="local-6989586621679681930"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681930"><span class="hs-identifier hs-var">dest</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HasCallStack =&gt; IO ()) -&gt; IO ()
forall a. HasCallStack =&gt; (HasCallStack =&gt; a) -&gt; a
</span><a href="../../base/src/GHC.Stack.html#withFrozenCallStack"><span class="hs-identifier hs-var">withFrozenCallStack</span></a></span><span> </span><span class="annot"><span class="annottext">((HasCallStack =&gt; IO ()) -&gt; IO ())
-&gt; (HasCallStack =&gt; IO ()) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1292"></span><span>  </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#info"><span class="hs-identifier hs-var">info</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681932"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Installing executable &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681931"><span class="hs-identifier hs-var">src</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; to &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681930"><span class="hs-identifier hs-var">dest</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1293"></span><span>  </span><span class="annot"><span class="annottext">String -&gt; String -&gt; IO ()
</span><a href="Distribution.Compat.CopyFile.html#copyExecutableFile"><span class="hs-identifier hs-var">copyExecutableFile</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681931"><span class="hs-identifier hs-var">src</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681930"><span class="hs-identifier hs-var">dest</span></a></span><span>
</span><span id="line-1294"></span><span>
</span><span id="line-1295"></span><span class="hs-comment">-- | Install a file that may or not be executable, preserving permissions.</span><span>
</span><span id="line-1296"></span><span class="annot"><a href="Distribution.Simple.Utils.html#installMaybeExecutableFile"><span class="hs-identifier hs-type">installMaybeExecutableFile</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-1297"></span><span id="installMaybeExecutableFile"><span class="annot"><span class="annottext">installMaybeExecutableFile :: Verbosity -&gt; String -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#installMaybeExecutableFile"><span class="hs-identifier hs-var hs-var">installMaybeExecutableFile</span></a></span></span><span> </span><span id="local-6989586621679681926"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681926"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679681925"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681925"><span class="hs-identifier hs-var">src</span></a></span></span><span> </span><span id="local-6989586621679681924"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681924"><span class="hs-identifier hs-var">dest</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HasCallStack =&gt; IO ()) -&gt; IO ()
forall a. HasCallStack =&gt; (HasCallStack =&gt; a) -&gt; a
</span><a href="../../base/src/GHC.Stack.html#withFrozenCallStack"><span class="hs-identifier hs-var">withFrozenCallStack</span></a></span><span> </span><span class="annot"><span class="annottext">((HasCallStack =&gt; IO ()) -&gt; IO ())
-&gt; (HasCallStack =&gt; IO ()) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1298"></span><span>  </span><span id="local-6989586621679681921"><span class="annot"><span class="annottext">Permissions
</span><a href="#local-6989586621679681921"><span class="hs-identifier hs-var">perms</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO Permissions
</span><a href="../../directory/src/System.Directory.html#getPermissions"><span class="hs-identifier hs-var">getPermissions</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681925"><span class="hs-identifier hs-var">src</span></a></span><span>
</span><span id="line-1299"></span><span>  </span><span class="hs-keyword">if</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Permissions -&gt; Bool
</span><a href="../../directory/src/System.Directory.Internal.Common.html#executable"><span class="hs-identifier hs-var hs-var">executable</span></a></span><span> </span><span class="annot"><span class="annottext">Permissions
</span><a href="#local-6989586621679681921"><span class="hs-identifier hs-var">perms</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">--only checks user x bit</span><span>
</span><span id="line-1300"></span><span>    </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#installExecutableFile"><span class="hs-identifier hs-var">installExecutableFile</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681926"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681925"><span class="hs-identifier hs-var">src</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681924"><span class="hs-identifier hs-var">dest</span></a></span><span>
</span><span id="line-1301"></span><span>    </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#installOrdinaryFile"><span class="hs-identifier hs-var">installOrdinaryFile</span></a></span><span>   </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681926"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681925"><span class="hs-identifier hs-var">src</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681924"><span class="hs-identifier hs-var">dest</span></a></span><span>
</span><span id="line-1302"></span><span>
</span><span id="line-1303"></span><span class="hs-comment">-- | Given a relative path to a file, copy it to the given directory, preserving</span><span>
</span><span id="line-1304"></span><span class="hs-comment">-- the relative path and creating the parent directories if needed.</span><span>
</span><span id="line-1305"></span><span class="annot"><a href="Distribution.Simple.Utils.html#copyFileTo"><span class="hs-identifier hs-type">copyFileTo</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-1306"></span><span id="copyFileTo"><span class="annot"><span class="annottext">copyFileTo :: Verbosity -&gt; String -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#copyFileTo"><span class="hs-identifier hs-var hs-var">copyFileTo</span></a></span></span><span> </span><span id="local-6989586621679681920"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681920"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679681919"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681919"><span class="hs-identifier hs-var">dir</span></a></span></span><span> </span><span id="local-6989586621679681918"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681918"><span class="hs-identifier hs-var">file</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HasCallStack =&gt; IO ()) -&gt; IO ()
forall a. HasCallStack =&gt; (HasCallStack =&gt; a) -&gt; a
</span><a href="../../base/src/GHC.Stack.html#withFrozenCallStack"><span class="hs-identifier hs-var">withFrozenCallStack</span></a></span><span> </span><span class="annot"><span class="annottext">((HasCallStack =&gt; IO ()) -&gt; IO ())
-&gt; (HasCallStack =&gt; IO ()) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1307"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679681915"><span class="annot"><span class="annottext">targetFile :: String
</span><a href="#local-6989586621679681915"><span class="hs-identifier hs-var hs-var">targetFile</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681919"><span class="hs-identifier hs-var">dir</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681918"><span class="hs-identifier hs-var">file</span></a></span><span>
</span><span id="line-1308"></span><span>  </span><span class="annot"><span class="annottext">Verbosity -&gt; Bool -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#createDirectoryIfMissingVerbose"><span class="hs-identifier hs-var">createDirectoryIfMissingVerbose</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681920"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#takeDirectory"><span class="hs-identifier hs-var">takeDirectory</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681915"><span class="hs-identifier hs-var">targetFile</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1309"></span><span>  </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#installOrdinaryFile"><span class="hs-identifier hs-var">installOrdinaryFile</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681920"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681918"><span class="hs-identifier hs-var">file</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681915"><span class="hs-identifier hs-var">targetFile</span></a></span><span>
</span><span id="line-1310"></span><span>
</span><span id="line-1311"></span><span class="hs-comment">-- | Common implementation of 'copyFiles', 'installOrdinaryFiles',</span><span>
</span><span id="line-1312"></span><span class="hs-comment">-- 'installExecutableFiles' and 'installMaybeExecutableFiles'.</span><span>
</span><span id="line-1313"></span><span class="annot"><a href="Distribution.Simple.Utils.html#copyFilesWith"><span class="hs-identifier hs-type">copyFilesWith</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1314"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-1315"></span><span id="copyFilesWith"><span class="annot"><span class="annottext">copyFilesWith :: (Verbosity -&gt; String -&gt; String -&gt; IO ())
-&gt; Verbosity -&gt; String -&gt; [(String, String)] -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#copyFilesWith"><span class="hs-identifier hs-var hs-var">copyFilesWith</span></a></span></span><span> </span><span id="local-6989586621679681913"><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; String -&gt; IO ()
</span><a href="#local-6989586621679681913"><span class="hs-identifier hs-var">doCopy</span></a></span></span><span> </span><span id="local-6989586621679681912"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681912"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679681911"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681911"><span class="hs-identifier hs-var">targetDir</span></a></span></span><span> </span><span id="local-6989586621679681910"><span class="annot"><span class="annottext">[(String, String)]
</span><a href="#local-6989586621679681910"><span class="hs-identifier hs-var">srcFiles</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HasCallStack =&gt; IO ()) -&gt; IO ()
forall a. HasCallStack =&gt; (HasCallStack =&gt; a) -&gt; a
</span><a href="../../base/src/GHC.Stack.html#withFrozenCallStack"><span class="hs-identifier hs-var">withFrozenCallStack</span></a></span><span> </span><span class="annot"><span class="annottext">((HasCallStack =&gt; IO ()) -&gt; IO ())
-&gt; (HasCallStack =&gt; IO ()) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1316"></span><span>
</span><span id="line-1317"></span><span>  </span><span class="hs-comment">-- Create parent directories for everything</span><span>
</span><span id="line-1318"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679681902"><span class="annot"><span class="annottext">dirs :: [String]
</span><a href="#local-6989586621679681902"><span class="hs-identifier hs-var hs-var">dirs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; [String] -&gt; [String]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681911"><span class="hs-identifier hs-var">targetDir</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">([String] -&gt; [String])
-&gt; ([(String, String)] -&gt; [String])
-&gt; [(String, String)]
-&gt; [String]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[String] -&gt; [String]
forall a. Eq a =&gt; [a] -&gt; [a]
</span><a href="../../base/src/Data.OldList.html#nub"><span class="hs-identifier hs-var">nub</span></a></span><span> </span><span class="annot"><span class="annottext">([String] -&gt; [String])
-&gt; ([(String, String)] -&gt; [String])
-&gt; [(String, String)]
-&gt; [String]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">((String, String) -&gt; String) -&gt; [(String, String)] -&gt; [String]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#takeDirectory"><span class="hs-identifier hs-var">takeDirectory</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; String)
-&gt; ((String, String) -&gt; String) -&gt; (String, String) -&gt; String
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(String, String) -&gt; String
forall a b. (a, b) -&gt; b
</span><a href="../../base/src/Data.Tuple.html#snd"><span class="hs-identifier hs-var">snd</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">([(String, String)] -&gt; [String]) -&gt; [(String, String)] -&gt; [String]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[(String, String)]
</span><a href="#local-6989586621679681910"><span class="hs-identifier hs-var">srcFiles</span></a></span><span>
</span><span id="line-1319"></span><span>  </span><span class="annot"><span class="annottext">(String -&gt; IO ()) -&gt; [String] -&gt; IO ()
forall (t :: * -&gt; *) (f :: * -&gt; *) a b.
(Foldable t, Applicative f) =&gt;
(a -&gt; f b) -&gt; t a -&gt; f ()
</span><a href="../../base/src/Data.Foldable.html#traverse_"><span class="hs-identifier hs-var">traverse_</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Verbosity -&gt; Bool -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#createDirectoryIfMissingVerbose"><span class="hs-identifier hs-var">createDirectoryIfMissingVerbose</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681912"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679681902"><span class="hs-identifier hs-var">dirs</span></a></span><span>
</span><span id="line-1320"></span><span>
</span><span id="line-1321"></span><span>  </span><span class="hs-comment">-- Copy all the files</span><span>
</span><span id="line-1322"></span><span>  </span><span class="annot"><span class="annottext">[IO ()] -&gt; IO ()
forall (t :: * -&gt; *) (m :: * -&gt; *) a.
(Foldable t, Monad m) =&gt;
t (m a) -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#sequence_"><span class="hs-identifier hs-var">sequence_</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679681900"><span class="annot"><span class="annottext">src :: String
</span><a href="#local-6989586621679681900"><span class="hs-identifier hs-var hs-var">src</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681899"><span class="hs-identifier hs-var">srcBase</span></a></span><span>   </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681898"><span class="hs-identifier hs-var">srcFile</span></a></span><span>
</span><span id="line-1323"></span><span>                  </span><span id="local-6989586621679681897"><span class="annot"><span class="annottext">dest :: String
</span><a href="#local-6989586621679681897"><span class="hs-identifier hs-var hs-var">dest</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681911"><span class="hs-identifier hs-var">targetDir</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681898"><span class="hs-identifier hs-var">srcFile</span></a></span><span>
</span><span id="line-1324"></span><span>               </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; String -&gt; IO ()
</span><a href="#local-6989586621679681913"><span class="hs-identifier hs-var">doCopy</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681912"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681900"><span class="hs-identifier hs-var">src</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681897"><span class="hs-identifier hs-var">dest</span></a></span><span>
</span><span id="line-1325"></span><span>            </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679681899"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681899"><span class="hs-identifier hs-var">srcBase</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679681898"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681898"><span class="hs-identifier hs-var">srcFile</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[(String, String)]
</span><a href="#local-6989586621679681910"><span class="hs-identifier hs-var">srcFiles</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-1326"></span><span>
</span><span id="line-1327"></span><span class="hs-comment">-- | Copies a bunch of files to a target directory, preserving the directory</span><span>
</span><span id="line-1328"></span><span class="hs-comment">-- structure in the target location. The target directories are created if they</span><span>
</span><span id="line-1329"></span><span class="hs-comment">-- do not exist.</span><span>
</span><span id="line-1330"></span><span class="hs-comment">--</span><span>
</span><span id="line-1331"></span><span class="hs-comment">-- The files are identified by a pair of base directory and a path relative to</span><span>
</span><span id="line-1332"></span><span class="hs-comment">-- that base. It is only the relative part that is preserved in the</span><span>
</span><span id="line-1333"></span><span class="hs-comment">-- destination.</span><span>
</span><span id="line-1334"></span><span class="hs-comment">--</span><span>
</span><span id="line-1335"></span><span class="hs-comment">-- For example:</span><span>
</span><span id="line-1336"></span><span class="hs-comment">--</span><span>
</span><span id="line-1337"></span><span class="hs-comment">-- &gt; copyFiles normal &quot;dist/src&quot;</span><span>
</span><span id="line-1338"></span><span class="hs-comment">-- &gt;    [(&quot;&quot;, &quot;src/Foo.hs&quot;), (&quot;dist/build/&quot;, &quot;src/Bar.hs&quot;)]</span><span>
</span><span id="line-1339"></span><span class="hs-comment">--</span><span>
</span><span id="line-1340"></span><span class="hs-comment">-- This would copy \&quot;src\/Foo.hs\&quot; to \&quot;dist\/src\/src\/Foo.hs\&quot; and</span><span>
</span><span id="line-1341"></span><span class="hs-comment">-- copy \&quot;dist\/build\/src\/Bar.hs\&quot; to \&quot;dist\/src\/src\/Bar.hs\&quot;.</span><span>
</span><span id="line-1342"></span><span class="hs-comment">--</span><span>
</span><span id="line-1343"></span><span class="hs-comment">-- This operation is not atomic. Any IO failure during the copy (including any</span><span>
</span><span id="line-1344"></span><span class="hs-comment">-- missing source files) leaves the target in an unknown state so it is best to</span><span>
</span><span id="line-1345"></span><span class="hs-comment">-- use it with a freshly created directory so that it can be simply deleted if</span><span>
</span><span id="line-1346"></span><span class="hs-comment">-- anything goes wrong.</span><span>
</span><span id="line-1347"></span><span class="hs-comment">--</span><span>
</span><span id="line-1348"></span><span class="annot"><a href="Distribution.Simple.Utils.html#copyFiles"><span class="hs-identifier hs-type">copyFiles</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-1349"></span><span id="copyFiles"><span class="annot"><span class="annottext">copyFiles :: Verbosity -&gt; String -&gt; [(String, String)] -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#copyFiles"><span class="hs-identifier hs-var hs-var">copyFiles</span></a></span></span><span> </span><span id="local-6989586621679681896"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681896"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span id="local-6989586621679681895"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681895"><span class="hs-identifier hs-var">fp</span></a></span></span><span> </span><span id="local-6989586621679681894"><span class="annot"><span class="annottext">[(String, String)]
</span><a href="#local-6989586621679681894"><span class="hs-identifier hs-var">fs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HasCallStack =&gt; IO ()) -&gt; IO ()
forall a. HasCallStack =&gt; (HasCallStack =&gt; a) -&gt; a
</span><a href="../../base/src/GHC.Stack.html#withFrozenCallStack"><span class="hs-identifier hs-var">withFrozenCallStack</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Verbosity -&gt; String -&gt; String -&gt; IO ())
-&gt; Verbosity -&gt; String -&gt; [(String, String)] -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#copyFilesWith"><span class="hs-identifier hs-var">copyFilesWith</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#copyFileVerbose"><span class="hs-identifier hs-var">copyFileVerbose</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681896"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681895"><span class="hs-identifier hs-var">fp</span></a></span><span> </span><span class="annot"><span class="annottext">[(String, String)]
</span><a href="#local-6989586621679681894"><span class="hs-identifier hs-var">fs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1350"></span><span>
</span><span id="line-1351"></span><span class="hs-comment">-- | This is like 'copyFiles' but uses 'installOrdinaryFile'.</span><span>
</span><span id="line-1352"></span><span class="hs-comment">--</span><span>
</span><span id="line-1353"></span><span class="annot"><a href="Distribution.Simple.Utils.html#installOrdinaryFiles"><span class="hs-identifier hs-type">installOrdinaryFiles</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-1354"></span><span id="installOrdinaryFiles"><span class="annot"><span class="annottext">installOrdinaryFiles :: Verbosity -&gt; String -&gt; [(String, String)] -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#installOrdinaryFiles"><span class="hs-identifier hs-var hs-var">installOrdinaryFiles</span></a></span></span><span> </span><span id="local-6989586621679681892"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681892"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span id="local-6989586621679681891"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681891"><span class="hs-identifier hs-var">fp</span></a></span></span><span> </span><span id="local-6989586621679681890"><span class="annot"><span class="annottext">[(String, String)]
</span><a href="#local-6989586621679681890"><span class="hs-identifier hs-var">fs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HasCallStack =&gt; IO ()) -&gt; IO ()
forall a. HasCallStack =&gt; (HasCallStack =&gt; a) -&gt; a
</span><a href="../../base/src/GHC.Stack.html#withFrozenCallStack"><span class="hs-identifier hs-var">withFrozenCallStack</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Verbosity -&gt; String -&gt; String -&gt; IO ())
-&gt; Verbosity -&gt; String -&gt; [(String, String)] -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#copyFilesWith"><span class="hs-identifier hs-var">copyFilesWith</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#installOrdinaryFile"><span class="hs-identifier hs-var">installOrdinaryFile</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681892"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681891"><span class="hs-identifier hs-var">fp</span></a></span><span> </span><span class="annot"><span class="annottext">[(String, String)]
</span><a href="#local-6989586621679681890"><span class="hs-identifier hs-var">fs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1355"></span><span>
</span><span id="line-1356"></span><span class="hs-comment">-- | This is like 'copyFiles' but uses 'installExecutableFile'.</span><span>
</span><span id="line-1357"></span><span class="hs-comment">--</span><span>
</span><span id="line-1358"></span><span class="annot"><a href="Distribution.Simple.Utils.html#installExecutableFiles"><span class="hs-identifier hs-type">installExecutableFiles</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-1359"></span><span>                          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-1360"></span><span id="installExecutableFiles"><span class="annot"><span class="annottext">installExecutableFiles :: Verbosity -&gt; String -&gt; [(String, String)] -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#installExecutableFiles"><span class="hs-identifier hs-var hs-var">installExecutableFiles</span></a></span></span><span> </span><span id="local-6989586621679681888"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681888"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span id="local-6989586621679681887"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681887"><span class="hs-identifier hs-var">fp</span></a></span></span><span> </span><span id="local-6989586621679681886"><span class="annot"><span class="annottext">[(String, String)]
</span><a href="#local-6989586621679681886"><span class="hs-identifier hs-var">fs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HasCallStack =&gt; IO ()) -&gt; IO ()
forall a. HasCallStack =&gt; (HasCallStack =&gt; a) -&gt; a
</span><a href="../../base/src/GHC.Stack.html#withFrozenCallStack"><span class="hs-identifier hs-var">withFrozenCallStack</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Verbosity -&gt; String -&gt; String -&gt; IO ())
-&gt; Verbosity -&gt; String -&gt; [(String, String)] -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#copyFilesWith"><span class="hs-identifier hs-var">copyFilesWith</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#installExecutableFile"><span class="hs-identifier hs-var">installExecutableFile</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681888"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681887"><span class="hs-identifier hs-var">fp</span></a></span><span> </span><span class="annot"><span class="annottext">[(String, String)]
</span><a href="#local-6989586621679681886"><span class="hs-identifier hs-var">fs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1361"></span><span>
</span><span id="line-1362"></span><span class="hs-comment">-- | This is like 'copyFiles' but uses 'installMaybeExecutableFile'.</span><span>
</span><span id="line-1363"></span><span class="hs-comment">--</span><span>
</span><span id="line-1364"></span><span class="annot"><a href="Distribution.Simple.Utils.html#installMaybeExecutableFiles"><span class="hs-identifier hs-type">installMaybeExecutableFiles</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-1365"></span><span>                               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-1366"></span><span id="installMaybeExecutableFiles"><span class="annot"><span class="annottext">installMaybeExecutableFiles :: Verbosity -&gt; String -&gt; [(String, String)] -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#installMaybeExecutableFiles"><span class="hs-identifier hs-var hs-var">installMaybeExecutableFiles</span></a></span></span><span> </span><span id="local-6989586621679681884"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681884"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span id="local-6989586621679681883"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681883"><span class="hs-identifier hs-var">fp</span></a></span></span><span> </span><span id="local-6989586621679681882"><span class="annot"><span class="annottext">[(String, String)]
</span><a href="#local-6989586621679681882"><span class="hs-identifier hs-var">fs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HasCallStack =&gt; IO ()) -&gt; IO ()
forall a. HasCallStack =&gt; (HasCallStack =&gt; a) -&gt; a
</span><a href="../../base/src/GHC.Stack.html#withFrozenCallStack"><span class="hs-identifier hs-var">withFrozenCallStack</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Verbosity -&gt; String -&gt; String -&gt; IO ())
-&gt; Verbosity -&gt; String -&gt; [(String, String)] -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#copyFilesWith"><span class="hs-identifier hs-var">copyFilesWith</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#installMaybeExecutableFile"><span class="hs-identifier hs-var">installMaybeExecutableFile</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681884"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681883"><span class="hs-identifier hs-var">fp</span></a></span><span> </span><span class="annot"><span class="annottext">[(String, String)]
</span><a href="#local-6989586621679681882"><span class="hs-identifier hs-var">fs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1367"></span><span>
</span><span id="line-1368"></span><span class="hs-comment">-- | This installs all the files in a directory to a target location,</span><span>
</span><span id="line-1369"></span><span class="hs-comment">-- preserving the directory layout. All the files are assumed to be ordinary</span><span>
</span><span id="line-1370"></span><span class="hs-comment">-- rather than executable files.</span><span>
</span><span id="line-1371"></span><span class="hs-comment">--</span><span>
</span><span id="line-1372"></span><span class="annot"><a href="Distribution.Simple.Utils.html#installDirectoryContents"><span class="hs-identifier hs-type">installDirectoryContents</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-1373"></span><span id="installDirectoryContents"><span class="annot"><span class="annottext">installDirectoryContents :: Verbosity -&gt; String -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#installDirectoryContents"><span class="hs-identifier hs-var hs-var">installDirectoryContents</span></a></span></span><span> </span><span id="local-6989586621679681880"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681880"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679681879"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681879"><span class="hs-identifier hs-var">srcDir</span></a></span></span><span> </span><span id="local-6989586621679681878"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681878"><span class="hs-identifier hs-var">destDir</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HasCallStack =&gt; IO ()) -&gt; IO ()
forall a. HasCallStack =&gt; (HasCallStack =&gt; a) -&gt; a
</span><a href="../../base/src/GHC.Stack.html#withFrozenCallStack"><span class="hs-identifier hs-var">withFrozenCallStack</span></a></span><span> </span><span class="annot"><span class="annottext">((HasCallStack =&gt; IO ()) -&gt; IO ())
-&gt; (HasCallStack =&gt; IO ()) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1374"></span><span>  </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#info"><span class="hs-identifier hs-var">info</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681880"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;copy directory '&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681879"><span class="hs-identifier hs-var">srcDir</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;' to '&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681878"><span class="hs-identifier hs-var">destDir</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;'.&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-1375"></span><span>  </span><span id="local-6989586621679681874"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679681874"><span class="hs-identifier hs-var">srcFiles</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO [String]
</span><a href="Distribution.Simple.Utils.html#getDirectoryContentsRecursive"><span class="hs-identifier hs-var">getDirectoryContentsRecursive</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681879"><span class="hs-identifier hs-var">srcDir</span></a></span><span>
</span><span id="line-1376"></span><span>  </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; [(String, String)] -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#installOrdinaryFiles"><span class="hs-identifier hs-var">installOrdinaryFiles</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681880"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681878"><span class="hs-identifier hs-var">destDir</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681879"><span class="hs-identifier hs-var">srcDir</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681873"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621679681873"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681873"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679681874"><span class="hs-identifier hs-var">srcFiles</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-1377"></span><span>
</span><span id="line-1378"></span><span class="hs-comment">-- | Recursively copy the contents of one directory to another path.</span><span>
</span><span id="line-1379"></span><span class="annot"><a href="Distribution.Simple.Utils.html#copyDirectoryRecursive"><span class="hs-identifier hs-type">copyDirectoryRecursive</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-1380"></span><span id="copyDirectoryRecursive"><span class="annot"><span class="annottext">copyDirectoryRecursive :: Verbosity -&gt; String -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#copyDirectoryRecursive"><span class="hs-identifier hs-var hs-var">copyDirectoryRecursive</span></a></span></span><span> </span><span id="local-6989586621679681872"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681872"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679681871"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681871"><span class="hs-identifier hs-var">srcDir</span></a></span></span><span> </span><span id="local-6989586621679681870"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681870"><span class="hs-identifier hs-var">destDir</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HasCallStack =&gt; IO ()) -&gt; IO ()
forall a. HasCallStack =&gt; (HasCallStack =&gt; a) -&gt; a
</span><a href="../../base/src/GHC.Stack.html#withFrozenCallStack"><span class="hs-identifier hs-var">withFrozenCallStack</span></a></span><span> </span><span class="annot"><span class="annottext">((HasCallStack =&gt; IO ()) -&gt; IO ())
-&gt; (HasCallStack =&gt; IO ()) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1381"></span><span>  </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#info"><span class="hs-identifier hs-var">info</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681872"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;copy directory '&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681871"><span class="hs-identifier hs-var">srcDir</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;' to '&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681870"><span class="hs-identifier hs-var">destDir</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;'.&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-1382"></span><span>  </span><span id="local-6989586621679681866"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679681866"><span class="hs-identifier hs-var">srcFiles</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO [String]
</span><a href="Distribution.Simple.Utils.html#getDirectoryContentsRecursive"><span class="hs-identifier hs-var">getDirectoryContentsRecursive</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681871"><span class="hs-identifier hs-var">srcDir</span></a></span><span>
</span><span id="line-1383"></span><span>  </span><span class="annot"><span class="annottext">(Verbosity -&gt; String -&gt; String -&gt; IO ())
-&gt; Verbosity -&gt; String -&gt; [(String, String)] -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#copyFilesWith"><span class="hs-identifier hs-var">copyFilesWith</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(String -&gt; String -&gt; IO ())
-&gt; Verbosity -&gt; String -&gt; String -&gt; IO ()
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; IO ()
</span><a href="Distribution.Compat.CopyFile.html#copyFile"><span class="hs-identifier hs-var">copyFile</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681872"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681870"><span class="hs-identifier hs-var">destDir</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681871"><span class="hs-identifier hs-var">srcDir</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681865"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1384"></span><span>                                                   </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621679681865"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681865"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679681866"><span class="hs-identifier hs-var">srcFiles</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-1385"></span><span>
</span><span id="line-1386"></span><span class="hs-comment">-------------------</span><span>
</span><span id="line-1387"></span><span class="hs-comment">-- File permissions</span><span>
</span><span id="line-1388"></span><span>
</span><span id="line-1389"></span><span class="hs-comment">-- | Like 'doesFileExist', but also checks that the file is executable.</span><span>
</span><span id="line-1390"></span><span class="annot"><a href="Distribution.Simple.Utils.html#doesExecutableExist"><span class="hs-identifier hs-type">doesExecutableExist</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-1391"></span><span id="doesExecutableExist"><span class="annot"><span class="annottext">doesExecutableExist :: String -&gt; IO Bool
</span><a href="Distribution.Simple.Utils.html#doesExecutableExist"><span class="hs-identifier hs-var hs-var">doesExecutableExist</span></a></span></span><span> </span><span id="local-6989586621679681864"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681864"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1392"></span><span>  </span><span id="local-6989586621679681863"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679681863"><span class="hs-identifier hs-var">exists</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO Bool
</span><a href="../../directory/src/System.Directory.html#doesFileExist"><span class="hs-identifier hs-var">doesFileExist</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681864"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-1393"></span><span>  </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679681863"><span class="hs-identifier hs-var">exists</span></a></span><span>
</span><span id="line-1394"></span><span>    </span><span class="hs-keyword">then</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621679681862"><span class="annot"><span class="annottext">Permissions
</span><a href="#local-6989586621679681862"><span class="hs-identifier hs-var">perms</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO Permissions
</span><a href="../../directory/src/System.Directory.html#getPermissions"><span class="hs-identifier hs-var">getPermissions</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681864"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-1395"></span><span>            </span><span class="annot"><span class="annottext">Bool -&gt; IO Bool
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Permissions -&gt; Bool
</span><a href="../../directory/src/System.Directory.Internal.Common.html#executable"><span class="hs-identifier hs-var hs-var">executable</span></a></span><span> </span><span class="annot"><span class="annottext">Permissions
</span><a href="#local-6989586621679681862"><span class="hs-identifier hs-var">perms</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1396"></span><span>    </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; IO Bool
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1397"></span><span>
</span><span id="line-1398"></span><span class="hs-comment">---------------------------</span><span>
</span><span id="line-1399"></span><span class="hs-comment">-- Temporary files and dirs</span><span>
</span><span id="line-1400"></span><span>
</span><span id="line-1401"></span><span class="hs-comment">-- | Advanced options for 'withTempFile' and 'withTempDirectory'.</span><span>
</span><span id="line-1402"></span><span class="hs-keyword">data</span><span> </span><span id="TempFileOptions"><span class="annot"><a href="Distribution.Simple.Utils.html#TempFileOptions"><span class="hs-identifier hs-var">TempFileOptions</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="TempFileOptions"><span class="annot"><a href="Distribution.Simple.Utils.html#TempFileOptions"><span class="hs-identifier hs-var">TempFileOptions</span></a></span></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-1403"></span><span>  </span><span id="optKeepTempFiles"><span class="annot"><span class="annottext">TempFileOptions -&gt; Bool
</span><a href="Distribution.Simple.Utils.html#optKeepTempFiles"><span class="hs-identifier hs-var hs-var">optKeepTempFiles</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>  </span><span class="hs-comment">-- ^ Keep temporary files?</span><span>
</span><span id="line-1404"></span><span>  </span><span class="hs-special">}</span><span>
</span><span id="line-1405"></span><span>
</span><span id="line-1406"></span><span class="annot"><a href="Distribution.Simple.Utils.html#defaultTempFileOptions"><span class="hs-identifier hs-type">defaultTempFileOptions</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Simple.Utils.html#TempFileOptions"><span class="hs-identifier hs-type">TempFileOptions</span></a></span><span>
</span><span id="line-1407"></span><span id="defaultTempFileOptions"><span class="annot"><span class="annottext">defaultTempFileOptions :: TempFileOptions
</span><a href="Distribution.Simple.Utils.html#defaultTempFileOptions"><span class="hs-identifier hs-var hs-var">defaultTempFileOptions</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TempFileOptions :: Bool -&gt; TempFileOptions
</span><a href="Distribution.Simple.Utils.html#TempFileOptions"><span class="hs-identifier hs-type">TempFileOptions</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">optKeepTempFiles :: Bool
</span><a href="Distribution.Simple.Utils.html#optKeepTempFiles"><span class="hs-identifier hs-var">optKeepTempFiles</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1408"></span><span>
</span><span id="line-1409"></span><span class="hs-comment">-- | Use a temporary filename that doesn't already exist.</span><span>
</span><span id="line-1410"></span><span class="hs-comment">--</span><span>
</span><span id="line-1411"></span><span id="local-6989586621679683048"><span class="annot"><a href="Distribution.Simple.Utils.html#withTempFile"><span class="hs-identifier hs-type">withTempFile</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>    </span><span class="hs-comment">-- ^ Temp dir to create the file in</span><span>
</span><span id="line-1412"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>   </span><span class="hs-comment">-- ^ File name template. See 'openTempFile'.</span><span>
</span><span id="line-1413"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Types.html#Handle"><span class="hs-identifier hs-type">Handle</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621679683048"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621679683048"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-1414"></span><span id="withTempFile"><span class="annot"><span class="annottext">withTempFile :: forall a. String -&gt; String -&gt; (String -&gt; Handle -&gt; IO a) -&gt; IO a
</span><a href="Distribution.Simple.Utils.html#withTempFile"><span class="hs-identifier hs-var hs-var">withTempFile</span></a></span></span><span> </span><span id="local-6989586621679681859"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681859"><span class="hs-identifier hs-var">tmpDir</span></a></span></span><span> </span><span id="local-6989586621679681858"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681858"><span class="hs-identifier hs-var">template</span></a></span></span><span> </span><span id="local-6989586621679681857"><span class="annot"><span class="annottext">String -&gt; Handle -&gt; IO a
</span><a href="#local-6989586621679681857"><span class="hs-identifier hs-var">action</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1415"></span><span>  </span><span class="annot"><span class="annottext">TempFileOptions
-&gt; String -&gt; String -&gt; (String -&gt; Handle -&gt; IO a) -&gt; IO a
forall a.
TempFileOptions
-&gt; String -&gt; String -&gt; (String -&gt; Handle -&gt; IO a) -&gt; IO a
</span><a href="Distribution.Simple.Utils.html#withTempFileEx"><span class="hs-identifier hs-var">withTempFileEx</span></a></span><span> </span><span class="annot"><span class="annottext">TempFileOptions
</span><a href="Distribution.Simple.Utils.html#defaultTempFileOptions"><span class="hs-identifier hs-var">defaultTempFileOptions</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681859"><span class="hs-identifier hs-var">tmpDir</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681858"><span class="hs-identifier hs-var">template</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; Handle -&gt; IO a
</span><a href="#local-6989586621679681857"><span class="hs-identifier hs-var">action</span></a></span><span>
</span><span id="line-1416"></span><span>
</span><span id="line-1417"></span><span class="hs-comment">-- | A version of 'withTempFile' that additionally takes a 'TempFileOptions'</span><span>
</span><span id="line-1418"></span><span class="hs-comment">-- argument.</span><span>
</span><span id="line-1419"></span><span id="local-6989586621679683046"><span class="annot"><a href="Distribution.Simple.Utils.html#withTempFileEx"><span class="hs-identifier hs-type">withTempFileEx</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Simple.Utils.html#TempFileOptions"><span class="hs-identifier hs-type">TempFileOptions</span></a></span><span>
</span><span id="line-1420"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-comment">-- ^ Temp dir to create the file in</span><span>
</span><span id="line-1421"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>   </span><span class="hs-comment">-- ^ File name template. See 'openTempFile'.</span><span>
</span><span id="line-1422"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Types.html#Handle"><span class="hs-identifier hs-type">Handle</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621679683046"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621679683046"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-1423"></span><span id="withTempFileEx"><span class="annot"><span class="annottext">withTempFileEx :: forall a.
TempFileOptions
-&gt; String -&gt; String -&gt; (String -&gt; Handle -&gt; IO a) -&gt; IO a
</span><a href="Distribution.Simple.Utils.html#withTempFileEx"><span class="hs-identifier hs-var hs-var">withTempFileEx</span></a></span></span><span> </span><span id="local-6989586621679681852"><span class="annot"><span class="annottext">TempFileOptions
</span><a href="#local-6989586621679681852"><span class="hs-identifier hs-var">opts</span></a></span></span><span> </span><span id="local-6989586621679681851"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681851"><span class="hs-identifier hs-var">tmpDir</span></a></span></span><span> </span><span id="local-6989586621679681850"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681850"><span class="hs-identifier hs-var">template</span></a></span></span><span> </span><span id="local-6989586621679681849"><span class="annot"><span class="annottext">String -&gt; Handle -&gt; IO a
</span><a href="#local-6989586621679681849"><span class="hs-identifier hs-var">action</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1424"></span><span>  </span><span class="annot"><span class="annottext">IO (String, Handle)
-&gt; ((String, Handle) -&gt; IO ())
-&gt; ((String, Handle) -&gt; IO a)
-&gt; IO a
forall a b c. IO a -&gt; (a -&gt; IO b) -&gt; (a -&gt; IO c) -&gt; IO c
</span><a href="../../base/src/Control.Exception.Base.html#bracket"><span class="hs-identifier hs-var">Exception.bracket</span></a></span><span>
</span><span id="line-1425"></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; String -&gt; IO (String, Handle)
</span><a href="../../base/src/System.IO.html#openTempFile"><span class="hs-identifier hs-var">openTempFile</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681851"><span class="hs-identifier hs-var">tmpDir</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681850"><span class="hs-identifier hs-var">template</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1426"></span><span>    </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621679681847"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681847"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679681846"><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679681846"><span class="hs-identifier hs-var">handle</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="annot"><span class="annottext">Handle -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.html#hClose"><span class="hs-identifier hs-var">hClose</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679681846"><span class="hs-identifier hs-var">handle</span></a></span><span>
</span><span id="line-1427"></span><span>                           </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#unless"><span class="hs-identifier hs-var">unless</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TempFileOptions -&gt; Bool
</span><a href="Distribution.Simple.Utils.html#optKeepTempFiles"><span class="hs-identifier hs-var hs-var">optKeepTempFiles</span></a></span><span> </span><span class="annot"><span class="annottext">TempFileOptions
</span><a href="#local-6989586621679681852"><span class="hs-identifier hs-var">opts</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-1428"></span><span>                             </span><span class="annot"><span class="annottext">() -&gt; IO () -&gt; IO ()
forall a. a -&gt; IO a -&gt; IO a
</span><a href="Distribution.Simple.Utils.html#handleDoesNotExist"><span class="hs-identifier hs-var">handleDoesNotExist</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; (String -&gt; IO ()) -&gt; String -&gt; IO ()
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; IO ()
</span><a href="../../directory/src/System.Directory.html#removeFile"><span class="hs-identifier hs-var">removeFile</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; IO ()) -&gt; String -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681847"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1429"></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">((String, Handle) -&gt; WithCallStack (IO a))
-&gt; WithCallStack ((String, Handle) -&gt; IO a)
forall a b.
(a -&gt; WithCallStack (IO b)) -&gt; WithCallStack (a -&gt; IO b)
</span><a href="Distribution.Compat.Stack.html#withLexicalCallStack"><span class="hs-identifier hs-var">withLexicalCallStack</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679681843"><span class="annot"><span class="annottext">(String, Handle)
</span><a href="#local-6989586621679681843"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(String -&gt; Handle -&gt; IO a) -&gt; (String, Handle) -&gt; IO a
forall a b c. (a -&gt; b -&gt; c) -&gt; (a, b) -&gt; c
</span><a href="../../base/src/Data.Tuple.html#uncurry"><span class="hs-identifier hs-var">uncurry</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; Handle -&gt; IO a
</span><a href="#local-6989586621679681849"><span class="hs-identifier hs-var">action</span></a></span><span> </span><span class="annot"><span class="annottext">(String, Handle)
</span><a href="#local-6989586621679681843"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1430"></span><span>
</span><span id="line-1431"></span><span class="hs-comment">-- | Create and use a temporary directory.</span><span>
</span><span id="line-1432"></span><span class="hs-comment">--</span><span>
</span><span id="line-1433"></span><span class="hs-comment">-- Creates a new temporary directory inside the given directory, making use</span><span>
</span><span id="line-1434"></span><span class="hs-comment">-- of the template. The temp directory is deleted after use. For example:</span><span>
</span><span id="line-1435"></span><span class="hs-comment">--</span><span>
</span><span id="line-1436"></span><span class="hs-comment">-- &gt; withTempDirectory verbosity &quot;src&quot; &quot;sdist.&quot; $ \tmpDir -&gt; do ...</span><span>
</span><span id="line-1437"></span><span class="hs-comment">--</span><span>
</span><span id="line-1438"></span><span class="hs-comment">-- The @tmpDir@ will be a new subdirectory of the given directory, e.g.</span><span>
</span><span id="line-1439"></span><span class="hs-comment">-- @src/sdist.342@.</span><span>
</span><span id="line-1440"></span><span class="hs-comment">--</span><span>
</span><span id="line-1441"></span><span id="local-6989586621679683042"><span class="annot"><a href="Distribution.Simple.Utils.html#withTempDirectory"><span class="hs-identifier hs-type">withTempDirectory</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621679683042"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621679683042"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-1442"></span><span id="withTempDirectory"><span class="annot"><span class="annottext">withTempDirectory :: forall a. Verbosity -&gt; String -&gt; String -&gt; (String -&gt; IO a) -&gt; IO a
</span><a href="Distribution.Simple.Utils.html#withTempDirectory"><span class="hs-identifier hs-var hs-var">withTempDirectory</span></a></span></span><span> </span><span id="local-6989586621679681840"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681840"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679681839"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681839"><span class="hs-identifier hs-var">targetDir</span></a></span></span><span> </span><span id="local-6989586621679681838"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681838"><span class="hs-identifier hs-var">template</span></a></span></span><span> </span><span id="local-6989586621679681837"><span class="annot"><span class="annottext">String -&gt; IO a
</span><a href="#local-6989586621679681837"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HasCallStack =&gt; IO a) -&gt; IO a
forall a. HasCallStack =&gt; (HasCallStack =&gt; a) -&gt; a
</span><a href="../../base/src/GHC.Stack.html#withFrozenCallStack"><span class="hs-identifier hs-var">withFrozenCallStack</span></a></span><span> </span><span class="annot"><span class="annottext">((HasCallStack =&gt; IO a) -&gt; IO a) -&gt; (HasCallStack =&gt; IO a) -&gt; IO a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-1443"></span><span>  </span><span class="annot"><span class="annottext">Verbosity
-&gt; TempFileOptions -&gt; String -&gt; String -&gt; (String -&gt; IO a) -&gt; IO a
forall a.
Verbosity
-&gt; TempFileOptions -&gt; String -&gt; String -&gt; (String -&gt; IO a) -&gt; IO a
</span><a href="Distribution.Simple.Utils.html#withTempDirectoryEx"><span class="hs-identifier hs-var">withTempDirectoryEx</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681840"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">TempFileOptions
</span><a href="Distribution.Simple.Utils.html#defaultTempFileOptions"><span class="hs-identifier hs-var">defaultTempFileOptions</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681839"><span class="hs-identifier hs-var">targetDir</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681838"><span class="hs-identifier hs-var">template</span></a></span><span>
</span><span id="line-1444"></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(String -&gt; HasCallStack =&gt; IO a) -&gt; WithCallStack (String -&gt; IO a)
forall a b.
(a -&gt; WithCallStack (IO b)) -&gt; WithCallStack (a -&gt; IO b)
</span><a href="Distribution.Compat.Stack.html#withLexicalCallStack"><span class="hs-identifier hs-var">withLexicalCallStack</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679681832"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681832"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO a
</span><a href="#local-6989586621679681837"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681832"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1445"></span><span>
</span><span id="line-1446"></span><span class="hs-comment">-- | A version of 'withTempDirectory' that additionally takes a</span><span>
</span><span id="line-1447"></span><span class="hs-comment">-- 'TempFileOptions' argument.</span><span>
</span><span id="line-1448"></span><span id="local-6989586621679683040"><span class="annot"><a href="Distribution.Simple.Utils.html#withTempDirectoryEx"><span class="hs-identifier hs-type">withTempDirectoryEx</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Utils.html#TempFileOptions"><span class="hs-identifier hs-type">TempFileOptions</span></a></span><span>
</span><span id="line-1449"></span><span>                       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621679683040"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621679683040"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-1450"></span><span id="withTempDirectoryEx"><span class="annot"><span class="annottext">withTempDirectoryEx :: forall a.
Verbosity
-&gt; TempFileOptions -&gt; String -&gt; String -&gt; (String -&gt; IO a) -&gt; IO a
</span><a href="Distribution.Simple.Utils.html#withTempDirectoryEx"><span class="hs-identifier hs-var hs-var">withTempDirectoryEx</span></a></span></span><span> </span><span id="local-6989586621679681829"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681829"><span class="hs-identifier hs-var">_verbosity</span></a></span></span><span> </span><span id="local-6989586621679681828"><span class="annot"><span class="annottext">TempFileOptions
</span><a href="#local-6989586621679681828"><span class="hs-identifier hs-var">opts</span></a></span></span><span> </span><span id="local-6989586621679681827"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681827"><span class="hs-identifier hs-var">targetDir</span></a></span></span><span> </span><span id="local-6989586621679681826"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681826"><span class="hs-identifier hs-var">template</span></a></span></span><span> </span><span id="local-6989586621679681825"><span class="annot"><span class="annottext">String -&gt; IO a
</span><a href="#local-6989586621679681825"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HasCallStack =&gt; IO a) -&gt; IO a
forall a. HasCallStack =&gt; (HasCallStack =&gt; a) -&gt; a
</span><a href="../../base/src/GHC.Stack.html#withFrozenCallStack"><span class="hs-identifier hs-var">withFrozenCallStack</span></a></span><span> </span><span class="annot"><span class="annottext">((HasCallStack =&gt; IO a) -&gt; IO a) -&gt; (HasCallStack =&gt; IO a) -&gt; IO a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-1451"></span><span>  </span><span class="annot"><span class="annottext">IO String -&gt; (String -&gt; IO ()) -&gt; (String -&gt; IO a) -&gt; IO a
forall a b c. IO a -&gt; (a -&gt; IO b) -&gt; (a -&gt; IO c) -&gt; IO c
</span><a href="../../base/src/Control.Exception.Base.html#bracket"><span class="hs-identifier hs-var">Exception.bracket</span></a></span><span>
</span><span id="line-1452"></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; String -&gt; IO String
</span><a href="Distribution.Compat.Internal.TempFile.html#createTempDirectory"><span class="hs-identifier hs-var">createTempDirectory</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681827"><span class="hs-identifier hs-var">targetDir</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681826"><span class="hs-identifier hs-var">template</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1453"></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#unless"><span class="hs-identifier hs-var">unless</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TempFileOptions -&gt; Bool
</span><a href="Distribution.Simple.Utils.html#optKeepTempFiles"><span class="hs-identifier hs-var hs-var">optKeepTempFiles</span></a></span><span> </span><span class="annot"><span class="annottext">TempFileOptions
</span><a href="#local-6989586621679681828"><span class="hs-identifier hs-var">opts</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1454"></span><span>     </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; (String -&gt; IO ()) -&gt; String -&gt; IO ()
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">() -&gt; IO () -&gt; IO ()
forall a. a -&gt; IO a -&gt; IO a
</span><a href="Distribution.Simple.Utils.html#handleDoesNotExist"><span class="hs-identifier hs-var">handleDoesNotExist</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; (String -&gt; IO ()) -&gt; String -&gt; IO ()
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; IO ()
</span><a href="../../directory/src/System.Directory.html#removeDirectoryRecursive"><span class="hs-identifier hs-var">removeDirectoryRecursive</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1455"></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(String -&gt; HasCallStack =&gt; IO a) -&gt; WithCallStack (String -&gt; IO a)
forall a b.
(a -&gt; WithCallStack (IO b)) -&gt; WithCallStack (a -&gt; IO b)
</span><a href="Distribution.Compat.Stack.html#withLexicalCallStack"><span class="hs-identifier hs-var">withLexicalCallStack</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679681819"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681819"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO a
</span><a href="#local-6989586621679681825"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681819"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1456"></span><span>
</span><span id="line-1457"></span><span class="hs-comment">-----------------------------------</span><span>
</span><span id="line-1458"></span><span class="hs-comment">-- Safely reading and writing files</span><span>
</span><span id="line-1459"></span><span>
</span><span id="line-1460"></span><span class="hs-comment">-- | Write a file but only if it would have new content. If we would be writing</span><span>
</span><span id="line-1461"></span><span class="hs-comment">-- the same as the existing content then leave the file as is so that we do not</span><span>
</span><span id="line-1462"></span><span class="hs-comment">-- update the file's modification time.</span><span>
</span><span id="line-1463"></span><span class="hs-comment">--</span><span>
</span><span id="line-1464"></span><span class="hs-comment">-- NB: Before Cabal-3.0 the file content was assumed to be</span><span>
</span><span id="line-1465"></span><span class="hs-comment">--     ASCII-representable. Since Cabal-3.0 the file is assumed to be</span><span>
</span><span id="line-1466"></span><span class="hs-comment">--     UTF-8 encoded.</span><span>
</span><span id="line-1467"></span><span class="annot"><a href="Distribution.Simple.Utils.html#rewriteFileEx"><span class="hs-identifier hs-type">rewriteFileEx</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-1468"></span><span id="rewriteFileEx"><span class="annot"><span class="annottext">rewriteFileEx :: Verbosity -&gt; String -&gt; String -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#rewriteFileEx"><span class="hs-identifier hs-var hs-var">rewriteFileEx</span></a></span></span><span> </span><span id="local-6989586621679681818"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681818"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679681817"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681817"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1469"></span><span>  </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; ByteString -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#rewriteFileLBS"><span class="hs-identifier hs-var">rewriteFileLBS</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681818"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681817"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; IO ()) -&gt; (String -&gt; ByteString) -&gt; String -&gt; IO ()
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; ByteString
</span><a href="Distribution.Utils.Generic.html#toUTF8LBS"><span class="hs-identifier hs-var">toUTF8LBS</span></a></span><span>
</span><span id="line-1470"></span><span>
</span><span id="line-1471"></span><span class="hs-comment">-- | Same as `rewriteFileEx` but for 'ByteString's.</span><span>
</span><span id="line-1472"></span><span class="annot"><a href="Distribution.Simple.Utils.html#rewriteFileLBS"><span class="hs-identifier hs-type">rewriteFileLBS</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">BS.ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-1473"></span><span id="rewriteFileLBS"><span class="annot"><span class="annottext">rewriteFileLBS :: Verbosity -&gt; String -&gt; ByteString -&gt; IO ()
</span><a href="Distribution.Simple.Utils.html#rewriteFileLBS"><span class="hs-identifier hs-var hs-var">rewriteFileLBS</span></a></span></span><span> </span><span id="local-6989586621679681816"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681816"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679681815"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681815"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span id="local-6989586621679681814"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679681814"><span class="hs-identifier hs-var">newContent</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1474"></span><span>  </span><span class="annot"><span class="annottext">(IO () -&gt; (IOException -&gt; IO ()) -&gt; IO ())
-&gt; (IOException -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b c. (a -&gt; b -&gt; c) -&gt; b -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#flip"><span class="hs-identifier hs-var">flip</span></a></span><span> </span><span class="annot"><span class="annottext">IO () -&gt; (IOException -&gt; IO ()) -&gt; IO ()
forall a. IO a -&gt; (IOException -&gt; IO a) -&gt; IO a
</span><a href="Distribution.Compat.Exception.html#catchIO"><span class="hs-identifier hs-var">catchIO</span></a></span><span> </span><span class="annot"><span class="annottext">IOException -&gt; IO ()
</span><a href="#local-6989586621679681812"><span class="hs-identifier hs-var">mightNotExist</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1475"></span><span>    </span><span id="local-6989586621679681811"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679681811"><span class="hs-identifier hs-var">existingContent</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; IO ByteString -&gt; IO ByteString
forall a. Verbosity -&gt; IO a -&gt; IO a
</span><a href="Distribution.Simple.Utils.html#annotateIO"><span class="hs-identifier hs-var">annotateIO</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681816"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">(IO ByteString -&gt; IO ByteString) -&gt; IO ByteString -&gt; IO ByteString
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; IO ByteString
</span><a href="../../bytestring/src/Data.ByteString.Lazy.html#readFile"><span class="hs-identifier hs-var">BS.readFile</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681815"><span class="hs-identifier hs-var">path</span></a></span><span>
</span><span id="line-1476"></span><span>    </span><span class="annot"><span class="annottext">Int64
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; IO Int64
forall a. a -&gt; IO a
</span><a href="../../base/src/GHC.IO.html#evaluate"><span class="hs-identifier hs-var">evaluate</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; Int64
</span><a href="../../bytestring/src/Data.ByteString.Lazy.html#length"><span class="hs-identifier hs-var">BS.length</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679681811"><span class="hs-identifier hs-var">existingContent</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1477"></span><span>    </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#unless"><span class="hs-identifier hs-var">unless</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679681811"><span class="hs-identifier hs-var">existingContent</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679681814"><span class="hs-identifier hs-var">newContent</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-1478"></span><span>      </span><span class="annot"><span class="annottext">Verbosity -&gt; IO () -&gt; IO ()
forall a. Verbosity -&gt; IO a -&gt; IO a
</span><a href="Distribution.Simple.Utils.html#annotateIO"><span class="hs-identifier hs-var">annotateIO</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681816"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-1479"></span><span>        </span><span class="annot"><span class="annottext">String -&gt; ByteString -&gt; IO ()
</span><a href="Distribution.Utils.Generic.html#writeFileAtomic"><span class="hs-identifier hs-var">writeFileAtomic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681815"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679681814"><span class="hs-identifier hs-var">newContent</span></a></span><span>
</span><span id="line-1480"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1481"></span><span>    </span><span id="local-6989586621679681812"><span class="annot"><span class="annottext">mightNotExist :: IOException -&gt; IO ()
</span><a href="#local-6989586621679681812"><span class="hs-identifier hs-var hs-var">mightNotExist</span></a></span></span><span> </span><span id="local-6989586621679681807"><span class="annot"><span class="annottext">IOException
</span><a href="#local-6989586621679681807"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">IOException -&gt; Bool
</span><a href="../../base/src/System.IO.Error.html#isDoesNotExistError"><span class="hs-identifier hs-var">isDoesNotExistError</span></a></span><span> </span><span class="annot"><span class="annottext">IOException
</span><a href="#local-6989586621679681807"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-1482"></span><span>                    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; IO () -&gt; IO ()
forall a. Verbosity -&gt; IO a -&gt; IO a
</span><a href="Distribution.Simple.Utils.html#annotateIO"><span class="hs-identifier hs-var">annotateIO</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681816"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; ByteString -&gt; IO ()
</span><a href="Distribution.Utils.Generic.html#writeFileAtomic"><span class="hs-identifier hs-var">writeFileAtomic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681815"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679681814"><span class="hs-identifier hs-var">newContent</span></a></span><span>
</span><span id="line-1483"></span><span>                    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-1484"></span><span>                    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IOException -&gt; IO ()
forall a. IOException -&gt; IO a
</span><a href="../../base/src/GHC.IO.Exception.html#ioError"><span class="hs-identifier hs-var">ioError</span></a></span><span> </span><span class="annot"><span class="annottext">IOException
</span><a href="#local-6989586621679681807"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-1485"></span><span>
</span><span id="line-1486"></span><span>
</span><span id="line-1487"></span><span class="hs-comment">-- | The path name that represents the current directory.</span><span>
</span><span id="line-1488"></span><span class="hs-comment">-- In Unix, it's @\&quot;.\&quot;@, but this is system-specific.</span><span>
</span><span id="line-1489"></span><span class="hs-comment">-- (E.g. AmigaOS uses the empty string @\&quot;\&quot;@ for the current directory.)</span><span>
</span><span id="line-1490"></span><span class="annot"><a href="Distribution.Simple.Utils.html#currentDir"><span class="hs-identifier hs-type">currentDir</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-1491"></span><span id="currentDir"><span class="annot"><span class="annottext">currentDir :: String
</span><a href="Distribution.Simple.Utils.html#currentDir"><span class="hs-identifier hs-var hs-var">currentDir</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;.&quot;</span></span><span>
</span><span id="line-1492"></span><span>
</span><span id="line-1493"></span><span class="annot"><a href="Distribution.Simple.Utils.html#shortRelativePath"><span class="hs-identifier hs-type">shortRelativePath</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-1494"></span><span id="shortRelativePath"><span class="annot"><span class="annottext">shortRelativePath :: String -&gt; String -&gt; String
</span><a href="Distribution.Simple.Utils.html#shortRelativePath"><span class="hs-identifier hs-var hs-var">shortRelativePath</span></a></span></span><span> </span><span id="local-6989586621679681806"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681806"><span class="hs-identifier hs-var">from</span></a></span></span><span> </span><span id="local-6989586621679681805"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681805"><span class="hs-identifier hs-var">to</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1495"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; [String] -&gt; ([String], [String])
forall a. Eq a =&gt; [a] -&gt; [a] -&gt; ([a], [a])
</span><a href="#local-6989586621679681804"><span class="hs-identifier hs-var">dropCommonPrefix</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; [String]
</span><a href="../../filepath/src/System.FilePath.Windows.html#splitDirectories"><span class="hs-identifier hs-var">splitDirectories</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681806"><span class="hs-identifier hs-var">from</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; [String]
</span><a href="../../filepath/src/System.FilePath.Windows.html#splitDirectories"><span class="hs-identifier hs-var">splitDirectories</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681805"><span class="hs-identifier hs-var">to</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1496"></span><span>        </span><span class="hs-special">(</span><span id="local-6989586621679681803"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679681803"><span class="hs-identifier hs-var">stuff</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679681802"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679681802"><span class="hs-identifier hs-var">path</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#joinPath"><span class="hs-identifier hs-var">joinPath</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; [String] -&gt; [String]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;..&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679681803"><span class="hs-identifier hs-var">stuff</span></a></span><span> </span><span class="annot"><span class="annottext">[String] -&gt; [String] -&gt; [String]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679681802"><span class="hs-identifier hs-var">path</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1497"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1498"></span><span>    </span><span id="local-6989586621679683034"><span class="annot"><a href="#local-6989586621679681804"><span class="hs-identifier hs-type">dropCommonPrefix</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Eq</span></span><span> </span><span class="annot"><a href="#local-6989586621679683034"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679683034"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679683034"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679683034"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679683034"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span></span><span>
</span><span id="line-1499"></span><span>    </span><span id="local-6989586621679681804"><span class="annot"><span class="annottext">dropCommonPrefix :: forall a. Eq a =&gt; [a] -&gt; [a] -&gt; ([a], [a])
</span><a href="#local-6989586621679681804"><span class="hs-identifier hs-var hs-var">dropCommonPrefix</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679681798"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679681798"><span class="hs-identifier hs-var">x</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679681797"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679681797"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679681796"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679681796"><span class="hs-identifier hs-var">y</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679681795"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679681795"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1500"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679681798"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679681796"><span class="hs-identifier hs-var">y</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[a] -&gt; [a] -&gt; ([a], [a])
forall a. Eq a =&gt; [a] -&gt; [a] -&gt; ([a], [a])
</span><a href="#local-6989586621679681804"><span class="hs-identifier hs-var">dropCommonPrefix</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679681797"><span class="hs-identifier hs-var">xs</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679681795"><span class="hs-identifier hs-var">ys</span></a></span><span>
</span><span id="line-1501"></span><span>    </span><span class="annot"><a href="#local-6989586621679681804"><span class="hs-identifier hs-var">dropCommonPrefix</span></a></span><span> </span><span id="local-6989586621679681794"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679681794"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span id="local-6989586621679681793"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679681793"><span class="hs-identifier hs-var">ys</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679681794"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679681793"><span class="hs-identifier hs-var">ys</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1502"></span><span>
</span><span id="line-1503"></span><span class="hs-comment">-- | Drop the extension if it's one of 'exeExtensions', or return the path</span><span>
</span><span id="line-1504"></span><span class="hs-comment">-- unchanged.</span><span>
</span><span id="line-1505"></span><span class="annot"><a href="Distribution.Simple.Utils.html#dropExeExtension"><span class="hs-identifier hs-type">dropExeExtension</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-1506"></span><span id="dropExeExtension"><span class="annot"><span class="annottext">dropExeExtension :: String -&gt; String
</span><a href="Distribution.Simple.Utils.html#dropExeExtension"><span class="hs-identifier hs-var hs-var">dropExeExtension</span></a></span></span><span> </span><span id="local-6989586621679681792"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681792"><span class="hs-identifier hs-var">filepath</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1507"></span><span>  </span><span class="hs-comment">-- System.FilePath's extension handling functions are horribly</span><span>
</span><span id="line-1508"></span><span>  </span><span class="hs-comment">-- inconsistent, consider:</span><span>
</span><span id="line-1509"></span><span>  </span><span class="hs-comment">--</span><span>
</span><span id="line-1510"></span><span>  </span><span class="hs-comment">--     isExtensionOf &quot;&quot; &quot;foo&quot;  == False but</span><span>
</span><span id="line-1511"></span><span>  </span><span class="hs-comment">--     isExtensionOf &quot;&quot; &quot;foo.&quot; == True.</span><span>
</span><span id="line-1512"></span><span>  </span><span class="hs-comment">--</span><span>
</span><span id="line-1513"></span><span>  </span><span class="hs-comment">-- On the other hand stripExtension doesn't remove the empty extension:</span><span>
</span><span id="line-1514"></span><span>  </span><span class="hs-comment">--</span><span>
</span><span id="line-1515"></span><span>  </span><span class="hs-comment">--    stripExtension &quot;&quot; &quot;foo.&quot; == Just &quot;foo.&quot;</span><span>
</span><span id="line-1516"></span><span>  </span><span class="hs-comment">--</span><span>
</span><span id="line-1517"></span><span>  </span><span class="hs-comment">-- Since by &quot;&quot; in exeExtensions we mean 'no extension' anyways we can</span><span>
</span><span id="line-1518"></span><span>  </span><span class="hs-comment">-- just always ignore it here.</span><span>
</span><span id="line-1519"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679681789"><span class="annot"><span class="annottext">exts :: [String]
</span><a href="#local-6989586621679681789"><span class="hs-identifier hs-var hs-var">exts</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681788"><span class="hs-identifier hs-var">ext</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621679681788"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681788"><span class="hs-identifier hs-var">ext</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="Distribution.Simple.Utils.html#exeExtensions"><span class="hs-identifier hs-var">exeExtensions</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681788"><span class="hs-identifier hs-var">ext</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span> </span><span class="hs-special">]</span><span> </span><span class="hs-keyword">in</span><span>
</span><span id="line-1520"></span><span>  </span><span class="annot"><span class="annottext">String -&gt; Maybe String -&gt; String
forall a. a -&gt; Maybe a -&gt; a
</span><a href="../../base/src/Data.Maybe.html#fromMaybe"><span class="hs-identifier hs-var">fromMaybe</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681792"><span class="hs-identifier hs-var">filepath</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe String -&gt; String) -&gt; Maybe String -&gt; String
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1521"></span><span>    </span><span id="local-6989586621679681786"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681786"><span class="hs-identifier hs-var">ext</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(String -&gt; Bool) -&gt; [String] -&gt; Maybe String
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; Bool) -&gt; t a -&gt; Maybe a
</span><a href="../../base/src/Data.Foldable.html#find"><span class="hs-identifier hs-var">find</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; String -&gt; Bool
</span><a href="../../filepath/src/System.FilePath.Windows.html#isExtensionOf"><span class="hs-operator hs-var">`FilePath.isExtensionOf`</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681792"><span class="hs-identifier hs-var">filepath</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679681789"><span class="hs-identifier hs-var">exts</span></a></span><span>
</span><span id="line-1522"></span><span>    </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681786"><span class="hs-identifier hs-var">ext</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; Maybe String
</span><a href="../../filepath/src/System.FilePath.Windows.html#stripExtension"><span class="hs-operator hs-var">`FilePath.stripExtension`</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681792"><span class="hs-identifier hs-var">filepath</span></a></span><span>
</span><span id="line-1523"></span><span>
</span><span id="line-1524"></span><span class="hs-comment">-- | List of possible executable file extensions on the current build</span><span>
</span><span id="line-1525"></span><span class="hs-comment">-- platform.</span><span>
</span><span id="line-1526"></span><span class="annot"><a href="Distribution.Simple.Utils.html#exeExtensions"><span class="hs-identifier hs-type">exeExtensions</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1527"></span><span id="exeExtensions"><span class="annot"><span class="annottext">exeExtensions :: [String]
</span><a href="Distribution.Simple.Utils.html#exeExtensions"><span class="hs-identifier hs-var hs-var">exeExtensions</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">OS
</span><a href="Distribution.System.html#buildOS"><span class="hs-identifier hs-var">buildOS</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1528"></span><span>  </span><span class="hs-comment">-- Possible improvement: on Windows, read the list of extensions from the</span><span>
</span><span id="line-1529"></span><span>  </span><span class="hs-comment">-- PATHEXT environment variable. By default PATHEXT is &quot;.com; .exe; .bat;</span><span>
</span><span id="line-1530"></span><span>  </span><span class="hs-comment">-- .cmd&quot;.</span><span>
</span><span id="line-1531"></span><span>  </span><span class="annot"><span class="annottext">OS
</span><a href="Distribution.System.html#Windows"><span class="hs-identifier hs-var">Windows</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;exe&quot;</span></span><span class="hs-special">]</span><span>
</span><span id="line-1532"></span><span>  </span><span class="annot"><span class="annottext">OS
</span><a href="Distribution.System.html#Ghcjs"><span class="hs-identifier hs-var">Ghcjs</span></a></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;exe&quot;</span></span><span class="hs-special">]</span><span>
</span><span id="line-1533"></span><span>  </span><span class="annot"><span class="annottext">OS
</span><span class="hs-identifier">_</span></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span class="hs-special">]</span><span>
</span><span id="line-1534"></span><span>
</span><span id="line-1535"></span><span class="hs-comment">-- ------------------------------------------------------------</span><span>
</span><span id="line-1536"></span><span class="hs-comment">-- * Finding the description file</span><span>
</span><span id="line-1537"></span><span class="hs-comment">-- ------------------------------------------------------------</span><span>
</span><span id="line-1538"></span><span>
</span><span id="line-1539"></span><span class="hs-comment">-- | Package description file (/pkgname/@.cabal@)</span><span>
</span><span id="line-1540"></span><span class="annot"><a href="Distribution.Simple.Utils.html#defaultPackageDesc"><span class="hs-identifier hs-type">defaultPackageDesc</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-1541"></span><span id="defaultPackageDesc"><span class="annot"><span class="annottext">defaultPackageDesc :: Verbosity -&gt; IO String
</span><a href="Distribution.Simple.Utils.html#defaultPackageDesc"><span class="hs-identifier hs-var hs-var">defaultPackageDesc</span></a></span></span><span> </span><span id="local-6989586621679681779"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681779"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; IO String
</span><a href="Distribution.Simple.Utils.html#tryFindPackageDesc"><span class="hs-identifier hs-var">tryFindPackageDesc</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681779"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="Distribution.Simple.Utils.html#currentDir"><span class="hs-identifier hs-var">currentDir</span></a></span><span>
</span><span id="line-1542"></span><span>
</span><span id="line-1543"></span><span class="hs-comment">-- |Find a package description file in the given directory.  Looks for</span><span>
</span><span id="line-1544"></span><span class="hs-comment">-- @.cabal@ files.</span><span>
</span><span id="line-1545"></span><span class="annot"><a href="Distribution.Simple.Utils.html#findPackageDesc"><span class="hs-identifier hs-type">findPackageDesc</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>                    </span><span class="hs-comment">-- ^Where to look</span><span>
</span><span id="line-1546"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- ^&lt;pkgname&gt;.cabal</span><span>
</span><span id="line-1547"></span><span id="findPackageDesc"><span class="annot"><span class="annottext">findPackageDesc :: String -&gt; IO (Either String String)
</span><a href="Distribution.Simple.Utils.html#findPackageDesc"><span class="hs-identifier hs-var hs-var">findPackageDesc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; IO (Either String String)
</span><a href="Distribution.Simple.Utils.html#findPackageDescCwd"><span class="hs-identifier hs-var">findPackageDescCwd</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;.&quot;</span></span><span>
</span><span id="line-1548"></span><span>
</span><span id="line-1549"></span><span class="hs-comment">-- | @since 3.4.0.0</span><span>
</span><span id="line-1550"></span><span class="annot"><a href="Distribution.Simple.Utils.html#findPackageDescCwd"><span class="hs-identifier hs-type">findPackageDescCwd</span></a></span><span>
</span><span id="line-1551"></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>                    </span><span class="hs-comment">-- ^ project root</span><span>
</span><span id="line-1552"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>                    </span><span class="hs-comment">-- ^ relative directory</span><span>
</span><span id="line-1553"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- ^ &lt;pkgname&gt;.cabal relative to the project root</span><span>
</span><span id="line-1554"></span><span id="findPackageDescCwd"><span class="annot"><span class="annottext">findPackageDescCwd :: String -&gt; String -&gt; IO (Either String String)
</span><a href="Distribution.Simple.Utils.html#findPackageDescCwd"><span class="hs-identifier hs-var hs-var">findPackageDescCwd</span></a></span></span><span> </span><span id="local-6989586621679681778"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681778"><span class="hs-identifier hs-var">cwd</span></a></span></span><span> </span><span id="local-6989586621679681777"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681777"><span class="hs-identifier hs-var">dir</span></a></span></span><span>
</span><span id="line-1555"></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621679681776"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679681776"><span class="hs-identifier hs-var">files</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO [String]
</span><a href="../../directory/src/System.Directory.html#getDirectoryContents"><span class="hs-identifier hs-var">getDirectoryContents</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681778"><span class="hs-identifier hs-var">cwd</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681777"><span class="hs-identifier hs-var">dir</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1556"></span><span>      </span><span class="hs-comment">-- to make sure we do not mistake a ~/.cabal/ dir for a &lt;pkgname&gt;.cabal</span><span>
</span><span id="line-1557"></span><span>      </span><span class="hs-comment">-- file we filter to exclude dirs and null base file names:</span><span>
</span><span id="line-1558"></span><span>      </span><span id="local-6989586621679681775"><span class="annot"><span class="annottext">[(String, String)]
</span><a href="#local-6989586621679681775"><span class="hs-identifier hs-var">cabalFiles</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">((String, String) -&gt; IO Bool)
-&gt; [(String, String)] -&gt; IO [(String, String)]
forall (m :: * -&gt; *) a.
Applicative m =&gt;
(a -&gt; m Bool) -&gt; [a] -&gt; m [a]
</span><a href="../../base/src/Control.Monad.html#filterM"><span class="hs-identifier hs-var">filterM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; IO Bool
</span><a href="../../directory/src/System.Directory.html#doesFileExist"><span class="hs-identifier hs-var">doesFileExist</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; IO Bool)
-&gt; ((String, String) -&gt; String) -&gt; (String, String) -&gt; IO Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(String, String) -&gt; String
forall a b. (a, b) -&gt; b
</span><a href="../../base/src/Data.Tuple.html#snd"><span class="hs-identifier hs-var">snd</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1559"></span><span>                       </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681777"><span class="hs-identifier hs-var">dir</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681774"><span class="hs-identifier hs-var">file</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681778"><span class="hs-identifier hs-var">cwd</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681777"><span class="hs-identifier hs-var">dir</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681774"><span class="hs-identifier hs-var">file</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1560"></span><span>                       </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621679681774"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681774"><span class="hs-identifier hs-var">file</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679681776"><span class="hs-identifier hs-var">files</span></a></span><span>
</span><span id="line-1561"></span><span>                       </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679681773"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681773"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679681772"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681772"><span class="hs-identifier hs-var">ext</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; (String, String)
</span><a href="../../filepath/src/System.FilePath.Windows.html#splitExtension"><span class="hs-identifier hs-var">splitExtension</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681774"><span class="hs-identifier hs-var">file</span></a></span><span>
</span><span id="line-1562"></span><span>                       </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681773"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681772"><span class="hs-identifier hs-var">ext</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;.cabal&quot;</span></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-1563"></span><span>      </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">((String, String) -&gt; String) -&gt; [(String, String)] -&gt; [String]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">(String, String) -&gt; String
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span> </span><span class="annot"><span class="annottext">[(String, String)]
</span><a href="#local-6989586621679681775"><span class="hs-identifier hs-var">cabalFiles</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1564"></span><span>        </span><span class="hs-special">[</span><span class="hs-special">]</span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Either String String -&gt; IO (Either String String)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Either String String
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span>  </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681770"><span class="hs-identifier hs-var">noDesc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1565"></span><span>        </span><span class="hs-special">[</span><span id="local-6989586621679681769"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681769"><span class="hs-identifier hs-var">cabalFile</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Either String String -&gt; IO (Either String String)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Either String String
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681769"><span class="hs-identifier hs-var">cabalFile</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1566"></span><span>        </span><span id="local-6989586621679681768"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679681768"><span class="hs-identifier hs-var">multiple</span></a></span></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Either String String -&gt; IO (Either String String)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Either String String
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span>  </span><span class="annot"><span class="annottext">(String -&gt; Either String String) -&gt; String -&gt; Either String String
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[String] -&gt; String
</span><a href="#local-6989586621679681767"><span class="hs-identifier hs-var">multiDesc</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679681768"><span class="hs-identifier hs-var">multiple</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1567"></span><span>
</span><span id="line-1568"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1569"></span><span>    </span><span class="annot"><a href="#local-6989586621679681770"><span class="hs-identifier hs-type">noDesc</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-1570"></span><span>    </span><span id="local-6989586621679681770"><span class="annot"><span class="annottext">noDesc :: String
</span><a href="#local-6989586621679681770"><span class="hs-identifier hs-var hs-var">noDesc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;No cabal file found.\n&quot;</span></span><span>
</span><span id="line-1571"></span><span>             </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Please create a package description file &lt;pkgname&gt;.cabal&quot;</span></span><span>
</span><span id="line-1572"></span><span>
</span><span id="line-1573"></span><span>    </span><span class="annot"><a href="#local-6989586621679681767"><span class="hs-identifier hs-type">multiDesc</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-1574"></span><span>    </span><span id="local-6989586621679681767"><span class="annot"><span class="annottext">multiDesc :: [String] -&gt; String
</span><a href="#local-6989586621679681767"><span class="hs-identifier hs-var hs-var">multiDesc</span></a></span></span><span> </span><span id="local-6989586621679681766"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679681766"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Multiple cabal files found.\n&quot;</span></span><span>
</span><span id="line-1575"></span><span>                  </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Please use only one of: &quot;</span></span><span>
</span><span id="line-1576"></span><span>                  </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; [String] -&gt; String
forall a. [a] -&gt; [[a]] -&gt; [a]
</span><a href="../../base/src/Data.OldList.html#intercalate"><span class="hs-identifier hs-var">intercalate</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;, &quot;</span></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679681766"><span class="hs-identifier hs-var">l</span></a></span><span>
</span><span id="line-1577"></span><span>
</span><span id="line-1578"></span><span class="hs-comment">-- |Like 'findPackageDesc', but calls 'die' in case of error.</span><span>
</span><span id="line-1579"></span><span class="annot"><a href="Distribution.Simple.Utils.html#tryFindPackageDesc"><span class="hs-identifier hs-type">tryFindPackageDesc</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-1580"></span><span id="tryFindPackageDesc"><span class="annot"><span class="annottext">tryFindPackageDesc :: Verbosity -&gt; String -&gt; IO String
</span><a href="Distribution.Simple.Utils.html#tryFindPackageDesc"><span class="hs-identifier hs-var hs-var">tryFindPackageDesc</span></a></span></span><span> </span><span id="local-6989586621679681765"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681765"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679681764"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681764"><span class="hs-identifier hs-var">dir</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1581"></span><span>  </span><span class="annot"><span class="annottext">(String -&gt; IO String)
-&gt; (String -&gt; IO String) -&gt; Either String String -&gt; IO String
forall a c b. (a -&gt; c) -&gt; (b -&gt; c) -&gt; Either a b -&gt; c
</span><a href="../../base/src/Data.Either.html#either"><span class="hs-identifier hs-var">either</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; IO String
forall a. Verbosity -&gt; String -&gt; IO a
</span><a href="Distribution.Simple.Utils.html#die%27"><span class="hs-identifier hs-var">die'</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681765"><span class="hs-identifier hs-var">verbosity</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO String
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Either String String -&gt; IO String)
-&gt; IO (Either String String) -&gt; IO String
forall (m :: * -&gt; *) a b. Monad m =&gt; (a -&gt; m b) -&gt; m a -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3D%3C%3C"><span class="hs-operator hs-var">=&lt;&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; IO (Either String String)
</span><a href="Distribution.Simple.Utils.html#findPackageDesc"><span class="hs-identifier hs-var">findPackageDesc</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681764"><span class="hs-identifier hs-var">dir</span></a></span><span>
</span><span id="line-1582"></span><span>
</span><span id="line-1583"></span><span class="hs-comment">-- | Like 'findPackageDescCwd', but calls 'die' in case of error.</span><span>
</span><span id="line-1584"></span><span class="hs-comment">--</span><span>
</span><span id="line-1585"></span><span class="hs-comment">-- @since 3.4.0.0</span><span>
</span><span id="line-1586"></span><span class="annot"><a href="Distribution.Simple.Utils.html#tryFindPackageDescCwd"><span class="hs-identifier hs-type">tryFindPackageDescCwd</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-1587"></span><span id="tryFindPackageDescCwd"><span class="annot"><span class="annottext">tryFindPackageDescCwd :: Verbosity -&gt; String -&gt; String -&gt; IO String
</span><a href="Distribution.Simple.Utils.html#tryFindPackageDescCwd"><span class="hs-identifier hs-var hs-var">tryFindPackageDescCwd</span></a></span></span><span> </span><span id="local-6989586621679681762"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681762"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679681761"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681761"><span class="hs-identifier hs-var">cwd</span></a></span></span><span> </span><span id="local-6989586621679681760"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681760"><span class="hs-identifier hs-var">dir</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1588"></span><span>  </span><span class="annot"><span class="annottext">(String -&gt; IO String)
-&gt; (String -&gt; IO String) -&gt; Either String String -&gt; IO String
forall a c b. (a -&gt; c) -&gt; (b -&gt; c) -&gt; Either a b -&gt; c
</span><a href="../../base/src/Data.Either.html#either"><span class="hs-identifier hs-var">either</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; IO String
forall a. Verbosity -&gt; String -&gt; IO a
</span><a href="Distribution.Simple.Utils.html#die%27"><span class="hs-identifier hs-var">die'</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681762"><span class="hs-identifier hs-var">verbosity</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO String
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Either String String -&gt; IO String)
-&gt; IO (Either String String) -&gt; IO String
forall (m :: * -&gt; *) a b. Monad m =&gt; (a -&gt; m b) -&gt; m a -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3D%3C%3C"><span class="hs-operator hs-var">=&lt;&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; IO (Either String String)
</span><a href="Distribution.Simple.Utils.html#findPackageDescCwd"><span class="hs-identifier hs-var">findPackageDescCwd</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681761"><span class="hs-identifier hs-var">cwd</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681760"><span class="hs-identifier hs-var">dir</span></a></span><span>
</span><span id="line-1589"></span><span>
</span><span id="line-1590"></span><span class="hs-comment">-- |Find auxiliary package information in the given directory.</span><span>
</span><span id="line-1591"></span><span class="hs-comment">-- Looks for @.buildinfo@ files.</span><span>
</span><span id="line-1592"></span><span class="annot"><a href="Distribution.Simple.Utils.html#findHookedPackageDesc"><span class="hs-identifier hs-type">findHookedPackageDesc</span></a></span><span>
</span><span id="line-1593"></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span>
</span><span id="line-1594"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>                 </span><span class="hs-comment">-- ^Directory to search</span><span>
</span><span id="line-1595"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">)</span><span>      </span><span class="hs-comment">-- ^/dir/@\/@/pkgname/@.buildinfo@, if present</span><span>
</span><span id="line-1596"></span><span id="findHookedPackageDesc"><span class="annot"><span class="annottext">findHookedPackageDesc :: Verbosity -&gt; String -&gt; IO (Maybe String)
</span><a href="Distribution.Simple.Utils.html#findHookedPackageDesc"><span class="hs-identifier hs-var hs-var">findHookedPackageDesc</span></a></span></span><span> </span><span id="local-6989586621679681759"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681759"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679681758"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681758"><span class="hs-identifier hs-var">dir</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1597"></span><span>    </span><span id="local-6989586621679681757"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679681757"><span class="hs-identifier hs-var">files</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO [String]
</span><a href="../../directory/src/System.Directory.html#getDirectoryContents"><span class="hs-identifier hs-var">getDirectoryContents</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681758"><span class="hs-identifier hs-var">dir</span></a></span><span>
</span><span id="line-1598"></span><span>    </span><span id="local-6989586621679681756"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679681756"><span class="hs-identifier hs-var">buildInfoFiles</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(String -&gt; IO Bool) -&gt; [String] -&gt; IO [String]
forall (m :: * -&gt; *) a.
Applicative m =&gt;
(a -&gt; m Bool) -&gt; [a] -&gt; m [a]
</span><a href="../../base/src/Control.Monad.html#filterM"><span class="hs-identifier hs-var">filterM</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; IO Bool
</span><a href="../../directory/src/System.Directory.html#doesFileExist"><span class="hs-identifier hs-var">doesFileExist</span></a></span><span>
</span><span id="line-1599"></span><span>                        </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681758"><span class="hs-identifier hs-var">dir</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681755"><span class="hs-identifier hs-var">file</span></a></span><span>
</span><span id="line-1600"></span><span>                        </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621679681755"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681755"><span class="hs-identifier hs-var">file</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679681757"><span class="hs-identifier hs-var">files</span></a></span><span>
</span><span id="line-1601"></span><span>                        </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679681754"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681754"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679681753"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681753"><span class="hs-identifier hs-var">ext</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; (String, String)
</span><a href="../../filepath/src/System.FilePath.Windows.html#splitExtension"><span class="hs-identifier hs-var">splitExtension</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681755"><span class="hs-identifier hs-var">file</span></a></span><span>
</span><span id="line-1602"></span><span>                        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681754"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681753"><span class="hs-identifier hs-var">ext</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="Distribution.Simple.Utils.html#buildInfoExt"><span class="hs-identifier hs-var">buildInfoExt</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-1603"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679681756"><span class="hs-identifier hs-var">buildInfoFiles</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1604"></span><span>        </span><span class="hs-special">[</span><span class="hs-special">]</span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe String -&gt; IO (Maybe String)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe String
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-1605"></span><span>        </span><span class="hs-special">[</span><span id="local-6989586621679681751"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681751"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe String -&gt; IO (Maybe String)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Maybe String
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679681751"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1606"></span><span>        </span><span class="annot"><span class="annottext">[String]
</span><span class="hs-identifier">_</span></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; String -&gt; IO (Maybe String)
forall a. Verbosity -&gt; String -&gt; IO a
</span><a href="Distribution.Simple.Utils.html#die%27"><span class="hs-identifier hs-var">die'</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679681759"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Multiple files with extension &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="Distribution.Simple.Utils.html#buildInfoExt"><span class="hs-identifier hs-var">buildInfoExt</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1607"></span><span>
</span><span id="line-1608"></span><span class="annot"><a href="Distribution.Simple.Utils.html#buildInfoExt"><span class="hs-identifier hs-type">buildInfoExt</span></a></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-1609"></span><span id="buildInfoExt"><span class="annot"><span class="annottext">buildInfoExt :: String
</span><a href="Distribution.Simple.Utils.html#buildInfoExt"><span class="hs-identifier hs-var hs-var">buildInfoExt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;.buildinfo&quot;</span></span><span>
</span><span id="line-1610"></span></pre></body></html>